I am new this Framework. I implemented crud operation, migration, unit testing also but I do know how to implement e2e testing in nest JS Framework. I tried to run the e2e testing program it's throwing an error
How to fix this error. I tried many ways but I could not get the solution
It showing this error No repository for "UserEntity" was found. Looks like this entity is not registered in current "default" connection?. So, I tried to change my database configuration
Database configuration
{
type: 'postgres',
host: process.env[`${process.env.NODE_ENV}_POSTGRES_HOST`],
port: parseInt(process.env[`${process.env.NODE_ENV}_POSTGRES_PORT`]) || 5432,
username: process.env[`${process.env.NODE_ENV}_POSTGRES_USER`],
password: process.env[`${process.env.NODE_ENV}_POSTGRES_PASSWORD`],
database: process.env[`${process.env.NODE_ENV}_POSTGRES_DATABASE`],
entities: ["dist/**/*.entity{ .ts,.js}"],
migrations: ["dist/database/migration/*.js"],
cli:{
migrationsDir: 'src/database/migration',
}
}
This problem is occurred in the entities column in the database configuration. If I change the entities directory the application cannot run. how to fix this issue
tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true
}
}