Skip to content

Commit

Permalink
test(require-hook): ensure let ... = require(...) is disallowed
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Oct 16, 2021
1 parent cb52383 commit 2e2cccc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/rules/__tests__/require-hook.test.ts
Expand Up @@ -145,6 +145,27 @@ ruleTester.run('require-hook', rule, {
},
],
},
{
code: dedent`
let { setup } = require('./test-utils');
describe('some tests', () => {
setup();
});
`,
errors: [
{
messageId: 'useHook',
line: 1,
column: 1,
},
{
messageId: 'useHook',
line: 4,
column: 3,
},
],
},
{
code: dedent`
describe('some tests', () => {
Expand Down

0 comments on commit 2e2cccc

Please sign in to comment.