阅读背景:

使用Supertest和模拟数据库进行Express JS集成测试

来源:互联网 

Is it possible to test an Express JS REST API using supertest but replacing the actual database connection with a mock database object? I have unit tests covering the database models and other parts of the application as well as functional tests of the API endpoints making actual database connections, but I have a weird requirement to create integration tests that are like the functional tests but use mock database connections. A sample endpoint controller is below:Is it possible to test an Express JS REST API u




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: