Skip to content

Commit 89e807e

Browse files
committed
Add failing tests
1 parent f3f4da8 commit 89e807e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test.js

+11
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ describe('detective-typescript', () => {
131131
assert(deps.length === 0);
132132
});
133133

134+
it('parses out TypeScript >=3.8 type imports', () => {
135+
const deps = detective('import type { Foo } from "foo"');
136+
assert(deps.length === 1);
137+
assert(deps[0] === 'foo');
138+
})
139+
140+
it('does not count TypeScript >=3.8 type imports if the skipTypeImports option is enabled', () => {
141+
const deps = detective('import type { Foo } from "foo"', {skipTypeImports: true});
142+
assert(deps.length === 0);
143+
});
144+
134145
it('supports CJS when mixedImports is true', () => {
135146
const deps = detective('const foo = require("foobar")', { mixedImports: true });
136147
assert(deps.length === 1);

0 commit comments

Comments
 (0)