You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when ts-jest/jest-preset-angular performs code compilation + type checking with TypeScript LanguageService/Program, TypeScript will attempt to do module resolution itself to gather enough information for the process.
The problem is when doing module resolution, TypeScript will also perform fs.readFileSync to get file content. So we end up in the situation that some files which are already read by TypeScript will be read again by Jest, which causes extra I/O on disk.
Therefore, I'd like to propose a feature request that jest-runtime shares cacheFS with jest-transform. The idea is that custom transformer can get/set this cacheFS so that already-read files shouldn't be read again.
The prototype implementation is: jest-runtime passes cacheFS to ScriptTransformer, ScriptTransformer passes that cacheFS to process.
Motivation
Improve performance by reducing I/O.
Example
This will help ts-jest/jest-preset-angular to speed up test run with isolatedModules: false
Pitch
The implementation will require changes in jest-runtime and jest-transform so it is core of Jest.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🚀 Feature Proposal
Currently, when
ts-jest
/jest-preset-angular
performs code compilation + type checking with TypeScript LanguageService/Program, TypeScript will attempt to do module resolution itself to gather enough information for the process.The problem is when doing module resolution, TypeScript will also perform
fs.readFileSync
to get file content. So we end up in the situation that some files which are already read by TypeScript will be read again by Jest, which causes extra I/O on disk.Therefore, I'd like to propose a feature request that
jest-runtime
sharescacheFS
withjest-transform
. The idea is that custom transformer can get/set thiscacheFS
so that already-read files shouldn't be read again.The prototype implementation is:
jest-runtime
passescacheFS
toScriptTransformer
,ScriptTransformer
passes thatcacheFS
toprocess
.Motivation
Improve performance by reducing I/O.
Example
This will help
ts-jest
/jest-preset-angular
to speed up test run withisolatedModules: false
Pitch
The implementation will require changes in
jest-runtime
andjest-transform
so it is core of Jest.cc @thymikee @SimenB
The text was updated successfully, but these errors were encountered: