Skip to content

Commit ebafcbf

Browse files
committed
no-restricted-paths: complete coverage
=
1 parent e6f5c13 commit ebafcbf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/src/rules/no-restricted-paths.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ ruleTester.run('no-restricted-paths', rule, {
2828
zones: [ { target: './tests/files/restricted-paths/client', from: './tests/files/restricted-paths/other' } ],
2929
} ],
3030
}),
31+
32+
33+
// irrelevant function calls
34+
test({ code: 'notrequire("../server/b.js")' }),
35+
test({
36+
code: 'notrequire("../server/b.js")',
37+
filename: testFilePath('./restricted-paths/client/a.js'),
38+
options: [ {
39+
zones: [ { target: './tests/files/restricted-paths/client', from: './tests/files/restricted-paths/server' } ],
40+
} ], }),
41+
42+
// no config
43+
test({ code: 'require("../server/b.js")' }),
44+
test({ code: 'import b from "../server/b.js"' }),
45+
46+
// builtin (ignore)
47+
test({ code: 'require("os")' })
3148
],
3249

3350
invalid: [

0 commit comments

Comments
 (0)