Skip to content

Commit

Permalink
test null check
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Jul 24, 2023
1 parent de93fe6 commit 2b39ad3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/lib/rule-tester/flat-rule-tester.js
Expand Up @@ -2437,6 +2437,13 @@ describe("FlatRuleTester", () => {
fatal: [{}]
});
}, "Test case property 'error' must be an object");
assert.throws(() => {
ruleTester.run("foo", rule, {
valid: [{ code: "'baz'" }],
invalid: [{ code: "'bar'", errors: [{ type: "Literal" }] }],
fatal: [{ error: null }]
});
}, "Test case property 'error' must be an object");

// wrong type `code`
assert.throws(() => {
Expand Down
7 changes: 7 additions & 0 deletions tests/lib/rule-tester/rule-tester.js
Expand Up @@ -2421,6 +2421,13 @@ describe("RuleTester", () => {
fatal: [{}]
});
}, "Test case property 'error' must be an object");
assert.throws(() => {
ruleTester.run("foo", rule, {
valid: [{ code: "'baz'" }],
invalid: [{ code: "'bar'", errors: [{ type: "Literal" }] }],
fatal: [{ error: null }]
});
}, "Test case property 'error' must be an object");

// wrong type `code`
assert.throws(() => {
Expand Down

0 comments on commit 2b39ad3

Please sign in to comment.