Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fuzzy-testing

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fuzzy-testing

Javascript fuzz testing tools

  • 0.0.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32
decreased by-28.89%
Maintainers
1
Weekly downloads
 
Created
Source

Fuzzy-Testing

Fuzz testing tools for node.

Because javascript is a loosely typed language, it is difficult to prepare for all the different possible types that a function might receive. In order to better build stable javascript applications, fuzzy-testing is a tool that will try many possible combinations of data types within arguments.

To install to your local project, simply run:

npm install fuzzy-testing

then, call one of the fuzzFunctions from within your testing code. If you're using jest, you can do something like this:

import { fuzzFunction } from 'fuzzy-testing';

expect(fuzzFunction(onlyBools, { maxArgs: 1 })).toEqual([]);

fuzzFunction

fuzzFunction is a function that takes a function and an object specifying it's options.

options
  • returnTypes: can be an array of types represented by strings, or a function that validates.
  • returnFirstError: boolean that does short circuit evaluation if true.
  • maxArgs: the maximum number of arguments to send to the function.
  • minArgs: the minimum number of arguments to send to the function.
  • argumentTypes: an array of argument types.
  • argumentValues: an array of values that will be tested.
  • iterations: the number of times that a function will be run per argument combination.
  • canThrowError: whether or not the function can throw an error or not.

fuzzReactComponent

Fuzzy testing also allows you to fuzz the render method of react component via fuzzReactComponent.

options
  • returnTypes: can be an array of types represented by strings, or a function that validates.
  • returnFirstError: boolean that does short circuit evaluation if true.
  • argumentValues: an array of values that will be tested.
  • iterations: the number of times that a function will be run per argument combination.
  • canThrowError: whether or not the function can throw an error or not.

Keywords

FAQs

Package last updated on 24 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc