我的文件夹结构如下:
Root
|- Scripts
|- ViewScripts
|- Feature_1
|- feature_1.js
|- Jasmine
|- Helpers
|- jasmine.js
|- Spy.js
|- mock-ajax.js
|- jasmine-jquery.js
|- Tests
|- Feature_1_Tests
|- feature_1.tests.js
|- chutzpah.json
|- gulpfile.js
|- package.json
chutzpah.json 的内容是:
{ "Framework": "jasmine", "References": [
{ "Path": "Scripts/jquery-1.10.2.js" },
{ "Path": "Scripts/Jasmine/Helpers/jasmine.js" },
{ "Path": "Scripts/Jasmine/Helpers/jasmine-html.js" },
{ "Path": "Scripts/Jasmine/Helpers/boot.js" },
{ "Path": "Scripts/Jasmine/Helpers/mock-ajax.js" },
{ "Path": "Scripts/Jasmine/Helpers/Spy.js" },
{ "Path": "Scripts/Jasmine/Helpers/jasmine-jquery.js" } ] }
gulpfile.js 的内容是:
const gulp = require('gulp');
const jasmine = require('gulp-jasmine');
gulp.task('tests', () =>
gulp
.src('Tests/**/*.tests.js')
.pipe(jasmine())
);
package.json 文件的内容为:
{
"name": "myapp",
"version": "1.0.0",
"description": "",
"main": "",
"scripts": {
"test": "gulp tests"
},
"author": "Jai Kumar",
"license": "ISC",
"devDependencies": {
"gulp": "^4.0.0",
"gulp-jasmine": "^4.0.0"
}
}
当我从 cmd 执行 gulp测试时:
但是当我在Visual Studio Test Explorer中使用chutzpah运行相同的测试用例时,所有测试用例都通过了。
请帮助我解决这个问题。 预先感谢。