【发布时间】:2018-04-04 01:15:20
【问题描述】:
我正在尝试这个:
expect(AP.require).toBeCalledWith('messages', () => {})
其中 AP.require 是一个模拟函数,它应该接收一个字符串和一个函数作为第二个参数。
测试失败并显示消息:
Expected mock function to have been called with:
[Function anonymous] as argument 2, but it was called with [Function anonymous]
【问题讨论】: