Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.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
Jestjs 嘲笑托贝和托贝的区别_Jestjs - Fatal编程技术网

Jestjs 嘲笑托贝和托贝的区别

Jestjs 嘲笑托贝和托贝的区别,jestjs,Jestjs,这在文档中并不明显,但是。。。用调用和用调用有什么区别?来自文档 .toHaveBeenCalledWith(arg1,arg2,…)别名下:.toBeCalledWith() 从源代码: /。。。 toBeCalledWith:createToBeCalledWithMatcher('toBeCalledWith'), toHaveBeenCalled:CreateToBeecalledMatcher(“toHaveBeenCalled”), toHaveBeenCalledTimes:C

这在文档中并不明显,但是。。。用
调用
和用
调用
有什么区别?

来自文档

.toHaveBeenCalledWith(arg1,arg2,…)
别名下:
.toBeCalledWith()

从源代码:

/。。。
toBeCalledWith:createToBeCalledWithMatcher('toBeCalledWith'),
toHaveBeenCalled:CreateToBeecalledMatcher(“toHaveBeenCalled”),
toHaveBeenCalledTimes:CreateToBeenCalledTimesMatcher(“toHaveBeenCalledTimes”),
toHaveBeenCalledWith:CreateToBeenCalledWith匹配器('toHaveBeenCalledWith'),
//...
它们是由
createToBeCalledWithMatcher
函数创建的,只使用不同的名称

所以,他们是一样的