【发布时间】:2014-09-25 12:30:38
【问题描述】:
我很难理解以下使用 mocha 和 chai 在 nodejs 中进行站点测试的代码:
suite('Global Tests', function(){
test('page has a valid title', function(){
assert(document.title && document.title.match(/\S/) &&
document.title.toUpperCase() === 'AHC');
});
});
令人困惑的是这段代码是如何工作的,但似乎没有遵循chai documentation 的断言。其中格式如下:
断言(表达式,消息)
【问题讨论】:
标签: node.js mocha.js functional-testing chai