We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bfcb36 commit 1a54fbfCopy full SHA for 1a54fbf
1 file changed
test/testFunctions.js
@@ -10,6 +10,16 @@ export default function test(options) {
10
const args = options.args || [];
11
const method = options.validator || options.sanitizer;
12
13
+ if (!method) {
14
+ throw new Error('test() requires either "validator" or "sanitizer" option');
15
+ }
16
+
17
+ if (typeof validator[method] !== 'function') {
18
+ throw new Error(format(
19
+ 'test() received invalid validator/sanitizer "%s"; expected a function name exported by validator',
20
+ method
21
+ ));
22
23
args.unshift(null);
24
25
if (options.expect) {
0 commit comments