[英]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.