We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3f4da8 commit 89e807eCopy full SHA for 89e807e
test/test.js
@@ -131,6 +131,17 @@ describe('detective-typescript', () => {
131
assert(deps.length === 0);
132
});
133
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
145
it('supports CJS when mixedImports is true', () => {
146
const deps = detective('const foo = require("foobar")', { mixedImports: true });
147
assert(deps.length === 1);
0 commit comments