This repo reproduces a jest issue with scoped modules when misusing the moduleDirectory config.
Tested locally on Linux Mint 20 Cinnamon with the following node and npm versions:
node --version
v14.9.0npm --version
6.14.8npm install
# Tests pass here
npm run test
# Tests fail here
npm run failing-testThe main config difference is that the failing test's jest config uses a moduleDirectory of ./ which prevents jest from resolving my-package within @my-scope/my-package.