我正在尝试这个:
expect(AP.require).toBeCalledWith('messages', () => {})
Run Code Online (Sandbox Code Playgroud)
其中AP.require是一个模拟函数,它应该接收一个字符串,一个函数作为第二个参数.
测试失败并显示以下消息:
Expected mock function to have been called with:
[Function anonymous] as argument 2, but it was called with [Function anonymous]
Run Code Online (Sandbox Code Playgroud)