Skip to main content

NodeJS

Dependencies

sudo apt install nodejs

Initialize a project

Enable CI Repository access

To use CI Fuzz and its dependencies you have to configure access to the CI repository. Your private token is available on your CI Download Portal Configuration page.

Add the following repository settings to your global ~/.npmrc:

~/.npmrc
//gitlab.code-intelligence.com/api/v4/projects/89/packages/npm/:_authToken="<YOUR_TOKEN>"

To use the CI repository in your project, add it to the projects .npmrc:

.npmrc
@jazzer.js:registry=https://gitlab.code-intelligence.com/api/v4/projects/89/packages/npm/

Enable Fuzz Testing

To enable fuzz testing in your project, add a dev-dependency to @jazzer.js/jest-runner to your project. To do so, execute the following command:

npm install --save-dev @jazzer.js/jest-runner@3.1.0

Integrate with Jest

To integrate CI Fuzz with your existing Jest setup, add the following code to your projects config file:

jest.config.js
module.exports = {
projects: [
{
displayName: "test",
},
{
testRunner: "@jazzer.js/jest-runner",
displayName: {
name: "Jazzer.js",
color: "cyan",
},
testMatch: ["<rootDir>/**/*.fuzz.js"],
},
],
};

Example Projects