When I try to run test:e2e in NestJS, I am getting the error bellow.
Does someone knows the solution? What should I add in package.json?
Thanks.
Cannot find module 'src/tokens/entities/tokens.entity' from '../src/token-stat/entities/token-stat.entity.ts'
1 | import { ApiProperty } from '@nestjs/swagger';
> 2 | import { Token } from 'src/tokens/entities/tokens.entity';
| ^
3 | import {
4 | Entity,
5 | PrimaryGeneratedColumn,
This is my package.json:
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"moduleNameMapper": {
"^src/(.*)$": "<rootDir>/$1"
},
"rootDir": "./src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
} ```