Skip to content

Commit

Permalink
test: fix broken tests
Browse files Browse the repository at this point in the history
the current file name is now computed from the existing files, so
- the file must exist
- there should be a filename defined in all tests
  • Loading branch information
AdriAt360 committed Jun 16, 2022
1 parent de33169 commit 2f9ba90
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Empty file.
20 changes: 16 additions & 4 deletions tests/src/rules/no-restricted-paths.js
Expand Up @@ -230,7 +230,10 @@ ruleTester.run('no-restricted-paths', rule, {
}),

// irrelevant function calls
test({ code: 'notrequire("../server/b.js")' }),
test({
code: 'notrequire("../server/b.js")',
filename: testFilePath('./restricted-paths/client/a.js'),
}),
test({
code: 'notrequire("../server/b.js")',
filename: testFilePath('./restricted-paths/client/a.js'),
Expand All @@ -247,11 +250,20 @@ ruleTester.run('no-restricted-paths', rule, {
}),

// no config
test({ code: 'require("../server/b.js")' }),
test({ code: 'import b from "../server/b.js"' }),
test({
code: 'require("../server/b.js")',
filename: testFilePath('./restricted-paths/client/a.js'),
}),
test({
code: 'import b from "../server/b.js"',
filename: testFilePath('./restricted-paths/client/a.js'),
}),

// builtin (ignore)
test({ code: 'require("os")' }),
test({
code: 'require("os")',
filename: testFilePath('./restricted-paths/client/a.js'),
}),
],

invalid: [
Expand Down

0 comments on commit 2f9ba90

Please sign in to comment.