javascript - 我如何使用 mocha chai 为这个功能编写测试。我一直在尝试做 expect(notification(app).to.equal(url, messageBody)
问题描述
const notification = async(app) => {
it does some for loop on app
await fetch (url, messageBody);
}
messageBody is an object
messageBody = {
method: 'POST',
body: {
name: 'User1',
text: 'hello'
},
headers: {
'Content-type': 'application/json'
}
};
我一直在尝试做expect(notification(app).to.equal(url,messageBody)。我得到assertionError预期未定义等于(url,messageBody)。
解决方案
推荐阅读
- python - CSV 阅读器没有足够的值来解压(预期 11,得到 1)
- python - TensorFlow 训练层时间计算
- python - 如何创建具有相同类型成员的静态类型 python 类
- cucumber - 黄瓜重新运行失败的测试 java jenkins
- android - Android 中的 Fontawesome 5,3 个文件
- c# - 实体框架 6 System.Threading.ThreadAbortException
- google-apps-script - 是否可以记录谁在 Google Drive 中打开文件
- kubernetes - k8s 容器和主机上的最大用户进程数
- android - Android Studio 模拟器:进程以退出代码 13 完成
- r - R中实际计算时间与预期时间之间的差距