feat(jest-haste-map): support dependencyExtractor written in ESM - #12008
Merged
Conversation
chentsulin
commented
Oct 28, 2021
chentsulin
commented
Oct 28, 2021
chentsulin
force-pushed
the
import-dependencyExtractor
branch
from
October 28, 2021 09:26
5c21bae to
db74246
Compare
SimenB
reviewed
Oct 28, 2021
| } | ||
|
|
||
| static create(options: Options): HasteMap { | ||
| static async create(options: Options): Promise<HasteMap> { |
Member
There was a problem hiding this comment.
code in general looks good, but this makes it a breaking change and must wait for Jest 28 🙂 I'll add it to the milestone so we don't forget
16 tasks
chentsulin
force-pushed
the
import-dependencyExtractor
branch
3 times, most recently
from
October 28, 2021 11:36
8cce621 to
f59420e
Compare
chentsulin
commented
Oct 28, 2021
| 'a.js': 'module.exports = {foo: 5};', | ||
| 'dependencyExtractor.mjs': ` | ||
| const DYNAMIC_IMPORT_RE = /(?:^|[^.]\\s*)(\\bdynamicImport\\s*?\\(\\s*?)([\`'"])([^\`'"]+)(\\2\\s*?\\))/g; | ||
| export function extract(code, filePath) { |
Contributor
Author
There was a problem hiding this comment.
Summary
Part of #11167.
See the discussion on the
dependencyExtractorconfig: #11167 (comment)Test plan
new HasteMap(...)calls toawait HasteMap.create(...)Runtime.createHasteMap(...)calls toawait Runtime.createHasteMap(...)