Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jest-haste-map): Fix slowdown on node versions > 10 (second attempt) #8806

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify: read does not throw, rewrite _buildFileMap to be simpler, r…
…emove async/await
vovkasm committed Aug 10, 2019
commit c824576a46b5ef06f80e23d686605568c72d7a54
10 changes: 2 additions & 8 deletions packages/jest-haste-map/src/index.ts
Original file line number Diff line number Diff line change
@@ -410,18 +410,12 @@ class HasteMap extends EventEmitter {
/**
* 2. crawl the file system.
*/
private async _buildFileMap(): Promise<{
private _buildFileMap(): Promise<{
removedFiles: FileData;
changedFiles?: FileData;
hasteMap: InternalHasteMap;
}> {
let hasteMap: InternalHasteMap;
try {
const read = this._options.resetCache ? createEmptyMap : this.read;
hasteMap = await read.call(this);
} catch {
hasteMap = createEmptyMap();
}
const hasteMap = this._options.resetCache ? createEmptyMap() : this.read();
return this._crawl(hasteMap);
}