Construct a test suite for a validator
The validated type
The validator to test
An array of valid raw and parsed inputs
A mapping of validation errors and invalid inputs
The name of the validator to test
suite( isStringArray, [ { input: [], parsed: [] }, { input: ["a"], parsed: ["a"] }, ], { "Not an array": [undefined, null, true, 1, "a", {}], "Not an array of strings": [[1]], }, ); Copy
suite( isStringArray, [ { input: [], parsed: [] }, { input: ["a"], parsed: ["a"] }, ], { "Not an array": [undefined, null, true, 1, "a", {}], "Not an array of strings": [[1]], }, );
Construct a test suite for a validator