Skip to content

Commit 0bb3101

Browse files
committed
Fix resolver test.
1 parent ed30de8 commit 0bb3101

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## main
22

3+
## 30.1.3
4+
5+
### Fixes
6+
7+
- Fix `unstable_mockModule` with `node:` prefixed core modules.
8+
39
## 30.1.2
410

511
### Fixes

packages/jest-resolve/src/resolver.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,7 @@ export default class Resolver {
463463
}
464464

465465
normalizeCoreModuleSpecifier(specifier: string): string {
466-
return specifier.startsWith('node:')
467-
? specifier.slice('node:'.length)
468-
: specifier;
466+
return specifier.startsWith('node:') ? specifier.slice(5) : specifier;
469467
}
470468

471469
getModule(name: string): string | null {
@@ -742,11 +740,6 @@ export default class Resolver {
742740
moduleName: string,
743741
options?: Pick<ResolveModuleConfig, 'conditions'>,
744742
): string | null {
745-
// Strip core module scheme if necessary.
746-
if (this.isCoreModule(moduleName)) {
747-
return this.normalizeCoreModuleSpecifier(moduleName);
748-
}
749-
750743
const dirname = path.dirname(from);
751744

752745
const {extensions, moduleDirectory, paths} = this._prepareForResolution(

0 commit comments

Comments
 (0)