Skip to content

Commit

Permalink
Add tests for extract_requires on export types (#4080)
Browse files Browse the repository at this point in the history
* Ignore import type for extract_requires

* Add test for ignore type exports
  • Loading branch information
elicwhite authored and cpojer committed Jul 20, 2017
1 parent 7a671ff commit 41153ab
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/jest-haste-map/src/lib/__tests__/extract_requires.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,22 @@ describe('extractRequires', () => {
it('ignores type imports', () => {
const code = [
"import type foo from 'bar';",
"import type {",
" bar,",
" baz,",
'import type {',
' bar,',
' baz,',
"} from 'wham'",
].join('\r\n');

expect(extractRequires(code)).toEqual([]);
});

it('ignores type exports', () => {
const code = [
'export type Foo = number;',
'export default {}',
"export * from 'module1'",
].join('\r\n');

expect(extractRequires(code)).toEqual(['module1']);
});
});

0 comments on commit 41153ab

Please sign in to comment.