Skip to content

Commit a49e72a

Browse files
ProdigySimljharb
authored andcommitted
[Tests] named: Add direct test for export = assignment in TS
1 parent 517fcb7 commit a49e72a

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const someObj = {
2+
FooBar: 12,
3+
};
4+
5+
export = someObj;

tests/src/rules/named.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,13 @@ context('TypeScript', function () {
388388
'import/resolver': { 'eslint-import-resolver-typescript': true },
389389
};
390390

391-
let valid = [];
391+
let valid = [
392+
test({
393+
code: `import { FooBar } from './typescript-export-assign-object'`,
394+
parser,
395+
settings,
396+
}),
397+
];
392398
const invalid = [
393399
// TODO: uncomment this test
394400
// test({
@@ -400,8 +406,17 @@ context('TypeScript', function () {
400406
// { message: 'a not found in ./export-star-3/b' },
401407
// ],
402408
// }),
409+
test({
410+
code: `import { NotExported } from './typescript-export-assign-object'`,
411+
parser,
412+
settings,
413+
errors: [{
414+
message: `NotExported not found in './typescript-export-assign-object'`,
415+
type: 'Identifier',
416+
}],
417+
}),
403418
];
404-
419+
405420
[
406421
'typescript',
407422
'typescript-declare',

0 commit comments

Comments
 (0)