Skip to content

Commit 154e805

Browse files
committed
testing: throw if find errors on valid assertions
1 parent 8a03a5f commit 154e805

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/rules/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ const ruleTester = new RuleTester();
4949
});
5050

5151
assertions.valid = assertions.valid.map((assertion) => {
52+
if (assertion.errors) {
53+
throw new Error(`Valid assertions for rule ${ruleName} should not have an \`errors\` array.`);
54+
}
5255
assertion.parserOptions = _.defaultsDeep(assertion.parserOptions, parserOptions);
5356

5457
return assertion;

0 commit comments

Comments
 (0)