Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
use Promise.resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 22, 2021
1 parent 3100747 commit ad2acbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/jest-transform.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
sourcefile: path,
loader: path.endsWith('.ts') ? 'ts' : 'default'
})
r.code = r.code.replace(/import\(/g, 'require(')
r.code = r.code.replace(/import\((.*)\)/g, 'Promise.resolve(require($1))')
return r
}
}

0 comments on commit ad2acbb

Please sign in to comment.