From 7c73be690a3621bacb1545eda12c203793f4c748 Mon Sep 17 00:00:00 2001 From: Cory Danielson Date: Mon, 16 Sep 2024 12:21:43 -0400 Subject: [PATCH] Add type-only import test case for dependencyExtractor --- .../src/lib/__tests__/dependencyExtractor.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js b/packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js index c1e4c574ddc4..e7c64865c210 100644 --- a/packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js +++ b/packages/jest-haste-map/src/lib/__tests__/dependencyExtractor.test.js @@ -92,8 +92,12 @@ describe('dependencyExtractor', () => { // Bad import typeof {foo} from 'inv1'; import type {foo} from 'inv2'; + import {type foo, typeof bar} from 'inv3'; + // Good + import {foo, typeof bar} from 'inv4'; + import {type foo, bar} from 'inv5'; `; - expect(extractor.extract(code)).toEqual(new Set([])); + expect(extractor.extract(code)).toEqual(new Set(['inv4', 'inv5'])); }); it('should extract dependencies from `export` statements', () => {