Jest,NestJS,TypeORM端到端测试

时间:2020-10-21 21:30:24

标签: jestjs linker-errors nestjs e2e-testing typeorm

在NestJS教程中,通过导入单个示例模块来设置E2E测试。 在typeORM实体之间关系更为复杂的应用程序中,这种模式似乎不起作用。在广泛检查相关文件中是否存在no inconsistencies in import statements并且没有丢失的TypeOrmModule.forFeature()之后,我放弃了并简单地导入了整个AppModule(应用程序的根模块-与NestJS默认设置相同)

1 个答案:

答案 0 :(得分:0)

简而言之,如果您看到表格

Error: Entity metadata for EntityA#entityB was not found. 
Check if you specified a correct entity object and if it's connected in the connection options.

您可以尝试导入所有相关模块,也可以仅导入整个应用程序。