Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 如何使用jest在模拟响应中获取响应状态?_Typescript_Jestjs_Typescript2.0 - Fatal编程技术网

Typescript 如何使用jest在模拟响应中获取响应状态?

Typescript 如何使用jest在模拟响应中获取响应状态?,typescript,jestjs,typescript2.0,Typescript,Jestjs,Typescript2.0,如何使用jest在没有返回函数的情况下获取响应状态和消息 file.test.ts function data(response:Response){ response.send("hai").status(200) } 我了解了如何使用jest测试此函数并检查响应结果,Hi@hari,您使用jest测试函数而不返回是什么意思?单元测试还是集成测试,您需要哪一个?集成test@hariprasanth您使用哪个集成测试库?

如何使用jest在没有返回函数的情况下获取响应状态和消息

file.test.ts

function data(response:Response){
response.send("hai").status(200)
}

我了解了如何使用jest测试此函数并检查响应结果,Hi@hari,您使用jest测试函数而不返回是什么意思?单元测试还是集成测试,您需要哪一个?集成test@hariprasanth您使用哪个集成测试库?