Closed
Description
Version
27.5.1 and v28.0.0-alpha.7
Steps to reproduce
For jest 27:
- Clone https://github.com/nickbabcock/jest-resolve-issue
- npm install
- npm test
For jest 28 alpha
- Clone https://github.com/nickbabcock/jest-resolve-issue
- npm install --save-dev jest@next
- npm test
Expected behavior
Welcome to Node.js v16.13.1.
Type ".help" for more information.
> const { MyClass } = require("jest-bug")
undefined
> const a = new MyClass();
undefined
> a.greet()
'hello from node'
Actual behavior
On jest 27:
Expected: "hello from node"
Received: "hello from browser"
On jest 28:
Cannot find module 'jest-bug' from 'tests/test.js'
Additional context
Related (but not dupe): #9771
Environment
System:
OS: Linux 5.16 Pop!_OS 20.04 LTS
CPU: (18) x64 AMD Ryzen 9 5900X 12-Core Processor
Binaries:
Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
npmPackages:
jest: ^28.0.0-alpha.7 => 28.0.0-alpha.7