From ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57 Mon Sep 17 00:00:00 2001 From: Ben Mosher Date: Thu, 17 May 2018 08:54:39 -0400 Subject: [PATCH] no-restricted-paths: complete coverage = --- tests/src/rules/no-restricted-paths.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/src/rules/no-restricted-paths.js b/tests/src/rules/no-restricted-paths.js index 88cc8ad15..13f8472cb 100644 --- a/tests/src/rules/no-restricted-paths.js +++ b/tests/src/rules/no-restricted-paths.js @@ -28,6 +28,23 @@ ruleTester.run('no-restricted-paths', rule, { zones: [ { target: './tests/files/restricted-paths/client', from: './tests/files/restricted-paths/other' } ], } ], }), + + + // irrelevant function calls + test({ code: 'notrequire("../server/b.js")' }), + test({ + code: 'notrequire("../server/b.js")', + filename: testFilePath('./restricted-paths/client/a.js'), + options: [ { + zones: [ { target: './tests/files/restricted-paths/client', from: './tests/files/restricted-paths/server' } ], + } ], }), + + // no config + test({ code: 'require("../server/b.js")' }), + test({ code: 'import b from "../server/b.js"' }), + + // builtin (ignore) + test({ code: 'require("os")' }) ], invalid: [