Skip to content

Commit

Permalink
[Tests] no-default-export, no-named-export: add test cases with n…
Browse files Browse the repository at this point in the history
…on-module `sourceType`
  • Loading branch information
ljharb committed Sep 30, 2024
1 parent 55fa203 commit 0bc1355
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/src/rules/no-default-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ const rule = require('rules/no-default-export');

ruleTester.run('no-default-export', rule, {
valid: [
test({
code: 'module.exports = function foo() {}',
parserOptions: {
sourceType: 'script',
},
}),
test({
code: 'module.exports = function foo() {}',
}),
Expand Down
6 changes: 6 additions & 0 deletions tests/src/rules/no-named-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ const rule = require('rules/no-named-export');

ruleTester.run('no-named-export', rule, {
valid: [].concat(
test({
code: 'module.export.foo = function () {}',
parserOptions: {
sourceType: 'script',
},
}),
test({
code: 'module.export.foo = function () {}',
}),
Expand Down

0 comments on commit 0bc1355

Please sign in to comment.