Last active
August 30, 2021 00:14
-
-
Save christianscott/70e7545b96ed4ad357a3dbaf6a3bfdaf to your computer and use it in GitHub Desktop.
HasteMap impl that does not crawl
This file contains hidden or 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
const { default: HasteMap } = require("jest-haste-map"); | |
class NoCrawlHasteMap extends HasteMap { | |
// https://github.com/facebook/jest/blob/master/packages/jest-haste-map/src/index.ts#L754-L798 | |
// usually calls out to a fn that runs `find` in the current directory, which is *incredibly* | |
// slow if you have a lot of files | |
async _crawl() { | |
return { | |
hasteMap: this._createEmptyMap(), | |
removedFiles: [], | |
}; | |
} | |
} | |
module.exports = NoCrawlHasteMap; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment