[英]Getting Jasmine to run on the server-side
我正在嘗試開始使用Node.JS在服務器端測試JavaScript
我正在使用grunt和grunt-jasmine-node ,但我無法讓它運行我的測試。
它只是記錄
PS C:\\ Development \\ NET \\ Source \\ jsn> grunt運行“jasmine_node”任務未定義
完成0.001秒0測試,0斷言,0失敗
完成,沒有錯誤。
這是我的Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jasmine_node: {
specNameMatcher: 'spec',
projectRoot: '.',
requirejs: false,
forceExit: true,
jUnit: {
report: false,
savePath : "./build/reports/jasmine/",
useDotNotation: true,
consolidate: true
}
}
});
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.registerTask('default', 'jasmine_node');
};
我的文件結構是這樣的:
那么,我做錯了什么?
這就像stub.js
文件甚至沒有被加載,因為它有一個console.log
調用來測試它。
或者:
.spec.js
要么
matchall: true
替換配置選項specNameMatcher
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.