@tsmirror/fuzzer
v0.0.2
Published
Fuzzer based on @tsmirror/reflect
Downloads
17
Readme
fuzzer
Toy fuzzer that calls a function with every possible arguments.
Usage
import { reflected } from "@tsmirror/reflect";
import fuzzer from "@tsmirror/fuzzer";
import assert from "assert";
fuzzer((x: string, y: string, z: string) => {
assert([x, y, z].concat("") === x + y + z, "Unexpected Array.concat behaviour");
})
Note
- For string, it uses the
minimaxir/big-list-of-naughty-strings
- For numbers, it uses a variety of edge case (0, -1, Infinity, ...)
- Enums are tested with all values
- Object, Interface, Tupple, Union are the cartesian products of their member's possible values.
- Other types are not yet handled