[英]jasmine-node tests aren't running
我有一個文件word-count.js
看起來像這樣:
function words(statement) {
words = {}
//some code here that does stuff
return words
}
module.exports = words;
和一個名為word-count_test.spec.js
的測試套件文件
var words = require('./word-count');
describe("words()", function() {
it("counts one word", function() {
var expectedCounts = { word: 1 };
expect(words("word")).toEqual(expectedCounts);
});
// more tests ...
});
這兩個文件位於同一文件夾中,但是當我運行時
$ jasmine-node word-count.js
Finished in 0 seconds
0 tests, 0 assertions, 0 failures, 0 skipped
為什么測試不起作用?
我在錯誤的文件上運行jasmine-node。
我在做什么( 不正確 ):
jasmine-node word-count.js
我應該做什么( 正確 ):
jasmine-node word-count_test.spec.js
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.