小编And*_*rde的帖子

如何使用 jest 测试 Nest js 中的异步函数

我用我的新框架 Nest js 做了一个简单的测试,但是第一次运行命令 npm run test 我收到此错误

\n
\xe2\x97\x8f  Cannot log after tests are done. Did you forget to wait for something async in your test?\n    Attempted to log "SUCCESS conection to MEMCACHED server".\n\n      21 |   // this function Stores a new value in Memcached.\n      22 |   setKey(key : string, value : string , timeExp:number) : Promise<boolean>{\n    > 23 |     // Transform the callback into a promise to be used in the controller\n         |                 ^\n      24 |     return new …
Run Code Online (Sandbox Code Playgroud)

jestjs nestjs

3
推荐指数
1
解决办法
1942
查看次数

标签 统计

jestjs ×1

nestjs ×1