-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: transform
js
ESM file from node_modules
`ts.LanguageService` somehow can't transform `js` file which has content in ESM. When dealing with those files, we simply transform them with `ts.transpileModule` API without applying any AST transformers. We don't apply type-check on these files either since they are prebuilt. This should benefit the performance and help users to work easier with ESM packages when running Jest in CJS mode. Fixes #2913
- Loading branch information
Showing
7 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
e2e/process-js-packages/__tests__/process-js-packages.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import camelCase from 'lodash-es/camelCase'; | ||
import { union } from 'set-utilities'; | ||
import { __assign } from 'tslib'; | ||
|
||
test('should pass', () => { | ||
expect(camelCase('foo-bar')).toBe('fooBar'); | ||
expect(typeof __assign).toBe('function'); | ||
expect(union(new Set([1, 2, 3]), new Set([4, 5, 6]))).toStrictEqual(new Set([1, 2, 3, 4, 5, 6])); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters