I have configured my ormconfiguration.json file as below:
[
{
"name": "development",
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "postgres",
"password": "",
"database": "grapqhltsserverboilerplate",
"synchronize": true,
"logging": true,
"entities": ["src/entity/**/*.ts"],
"migrations": ["src/migration/**/*.ts"],
"subscribers": ["src/subscriber/**/*.ts"],
"cli": {
"entitiesDir": "src/entity",
"migrationsDir": "src/migration",
"subscribersDir": "src/subscriber"
}
},
{
"name": "test",
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "postgres",
"password": "",
"database": "grapqhltsserverboilerplatetest",
"synchronize": true,
"logging": false,
"dropSchema": true,
"entities": ["src/entity/**/*.ts"],
"migrations": ["src/migration/**/*.ts"],
"subscribers": ["src/subscriber/**/*.ts"],
"cli": {
"entitiesDir": "src/entity",
"migrationsDir": "src/migration",
"subscribersDir": "src/subscriber"
}
{
"name": "test",
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "postgres",
"password": "",
"database": "grapqhltsserverboilerplatetest",
"synchronize": true,
"logging": false,
"dropSchema": true,
"entities": ["src/entity/**/*.ts"],
"migrations": ["src/migration/**/*.ts"],
"subscribers": ["src/subscriber/**/*.ts"],
"cli": {
"entitiesDir": "src/entity",
"migrationsDir": "src/migration",
"subscribersDir": "src/subscriber"
}
}
]
after this when i am trying to run yarn test it gives error saying that 'cannot find connection test as it is not defined in any of the orm configuration file.' In yarn test I am doing like "SET NODE_ENV=test & jest --watch". I am not able to get what is the problem. redis is working fine also both of the database on postgres are created successfully.
Aucun commentaire:
Enregistrer un commentaire