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
Do you want to request a feature or report a bug?
Feature, I suppose
What is the current behavior?
As of the behavior introduced in #2859, all test files are read from disk twice; once inrunTest.js in order to check for docblocks, and once in jest-runtime to actually transform and run it. This is unnecessary, the content should only be read once.
If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.
N/A
What is the expected behavior?
That the source code is only read once. See @cpojer's suggestion in #2859
I'm a bit worried about the fact that this will end up reading every test file twice and we could potentially change things around by passing a fake FS into ModuleLoader that has a cache, like this:
new ModuleLoader({
…,
cacheFS: {
[path]: source,
},
});
and then later pass that source to transform inside of jest-runtime so that we don't read the same file twice.
The idea was to change jest-runtime to accept a cacheFS property in the constructor which is just a map from path -> source. Then inside of _execModule we could pass on the source that we already read to the transform function somehow. Basically we could do transform(…, {source: this._cacheFS[pathToFile] || null}) – does that make sense?
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
N/A
The text was updated successfully, but these errors were encountered:
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.
Do you want to request a feature or report a bug?
Feature, I suppose
What is the current behavior?
As of the behavior introduced in #2859, all test files are read from disk twice; once in
runTest.js
in order to check for docblocks, and once injest-runtime
to actually transform and run it. This is unnecessary, the content should only be read once.If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can
yarn install
andyarn test
.N/A
What is the expected behavior?
That the source code is only read once. See @cpojer's suggestion in #2859
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
N/A
The text was updated successfully, but these errors were encountered: