Skip to content

Commit

Permalink
[Tests] named: Add direct test for export = assignment in TS
Browse files Browse the repository at this point in the history
  • Loading branch information
ProdigySim committed Apr 12, 2022
1 parent 995c12c commit e7a6c8d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/files/typescript-export-assign-object.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const someObj = {
FooBar: 12,
};

export = someObj;
17 changes: 16 additions & 1 deletion tests/src/rules/named.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,13 @@ context('TypeScript', function () {
'import/resolver': { 'eslint-import-resolver-typescript': true },
};

let valid = [];
let valid = [
test({
code: `import { FooBar } from './typescript-export-assign-object'`,
parser,
settings,
}),
];
const invalid = [
// TODO: uncomment this test
// test({
Expand All @@ -400,6 +406,15 @@ context('TypeScript', function () {
// { message: 'a not found in ./export-star-3/b' },
// ],
// }),
test({
code: `import { NotExported } from './typescript-export-assign-object'`,
parser,
settings,
errors: [{
message: `NotExported not found in './typescript-export-assign-object'`,
type: 'Identifier',
}],
}),
];

[
Expand Down

0 comments on commit e7a6c8d

Please sign in to comment.