# setup code
mkdir ~/tmp
cd ~/tmp
git clone https://github.com/nestjs/typescript-starter.git
npm install
# confirm tests pass
npm test
# move package
mv ~/tmp/typescript-starter/node_modules/@nestjs/common/ ~/tmp/
# create symlink
ln -s ~/tmp/common/ ~/tmp/typescript-starter/node_modules/@nestjs/common
# rerun tests
npm test
Tests show error:
> [email protected] test /home/mchelen/tmp/typescript-starter
> jest
FAIL src/app.controller.spec.ts
● Test suite failed to run
Cannot find module 'reflect-metadata' from 'index.js'
10 | * MIT Licensed
11 | */
> 12 | require("reflect-metadata");
| ^
13 | __export(require("./cache"));
14 | __export(require("./decorators"));
15 | __export(require("./enums"));
at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:221:17)
at Object.<anonymous> (../../common/index.js:12:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.44s
Ran all test suites.
npm ERR! Test failed. See above for more details.
Related:
kulshekhar/ts-jest#825
jestjs/jest#1477