From 470adb3c9897c8e4a5fde85bfe0778fd15eff44c Mon Sep 17 00:00:00 2001 From: Khaled Yakdan Date: Wed, 8 Feb 2023 05:51:26 +0100 Subject: [PATCH] docs: fix typo and explain FuzzedDataProvider in Jest documentation --- docs/jest-integration.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/jest-integration.md b/docs/jest-integration.md index 10e77817..6afeffbe 100644 --- a/docs/jest-integration.md +++ b/docs/jest-integration.md @@ -87,7 +87,7 @@ which can be specified through the CLI client. } ``` -## Writing a Jest fuzz tests +## Writing a Jest fuzz test To create a fuzz test, the `fuzz` function on Jest's `test` and `it` can be used. @@ -116,9 +116,11 @@ describe("My describe", () => { }); ``` -However, the provided `Buffer` is not the nicest abstraction to work with. For -that reason, Jazzer.js provides the wrapper class `FuzzedDataProvider`. An -example on how to use everything in combination is shown below. +If the function you want to test expects parameters of types other than +`Buffer`, you have to take care of constructing the corresponding arguments from +the provided buffer. To facilitate this step, Jazzer.js provides a utility class +`FuzzedDataProvider` that you can use to consume data of certain types from the +fuzzer input. An example on how to use everything in combination is shown below. ```js const target = require("./target");