jazzer.js/examples/jest_integration at main · CodeIntelligenceTesting/jazzer.js...
source link: https://github.com/CodeIntelligenceTesting/jazzer.js/tree/main/examples/jest_integration
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Jest Integration Example
Detailed documentation on the Jest integration is available in the main Jazzer.js documentation.
Quickstart
To use the Jest integration install the
@jazzer.js/jest-runner
package and configure it as a dedicated test runner in
package.json
.
The example below shows how to configure the Jazzer.js Jest integration in combination with the normal Jest runner.
"jest": {
"projects": [
{
"displayName": "test"
},
{
"runner": "@jazzer.js/jest-runner",
"displayName": {
"name": "Jazzer.js",
"color": "cyan"
},
"testMatch": [
"<rootDir>/**/*.fuzz.js"
]
}
]
}
Further configuration can be specified in .jazzerjsrc.json
in the following
format:
{
"includes": ["*"],
"excludes": ["node_modules"],
"customHooks": [],
"fuzzerOptions": [],
"sync": false
}
Write a fuzz test like:
// file: jazzerjs.fuzz.js
describe("My describe", () => {
it.fuzz("My fuzz test", (data) => {
target.fuzzMe(data);
});
});
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK