Skip to content

Commit 3133c4e

Browse files
committed
test: properly report missing errors; use file extension in import
1 parent f6946a5 commit 3133c4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/rules/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const main = async () => {
5858
*/
5959
let assertions;
6060
try {
61-
assertions = (await import(`./assertions/${camelCase(ruleName)}`)).default;
61+
assertions = (await import(`./assertions/${camelCase(ruleName)}.js`)).default;
6262
} catch (error) {
6363
// eslint-disable-next-line no-console -- Reporting back to tester
6464
console.error(error);
@@ -84,7 +84,7 @@ const main = async () => {
8484
Reflect.deleteProperty(assertion, 'ignoreReadme');
8585
assertion.parserOptions = defaultsDeep(assertion.parserOptions, parserOptions);
8686
for (const error of /** @type {import('eslint').RuleTester.TestCaseError[]} */ (
87-
assertion.errors
87+
assertion.errors || []
8888
)) {
8989
if (!('line' in error)) {
9090
count++;

0 commit comments

Comments
 (0)