Skip to content

Unable to give references of file needed in specs from gulpfile.js  #100

Description

@jai-kumar

Using following file in jasmine specs:

  1. jasmine.js
  2. Spy.js
  3. mock-ajax.js
  4. jasmine-jquery.js

Content of chutzpah.json is :

{ "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" } ] }

Content of gulpfile.js is :

const gulp = require('gulp');
const jasmine = require('gulp-jasmine');

gulp.task('tests', () =>
gulp
.src('Tests/**/*.tests.js')
.pipe(jasmine())
);
Content of package.json file is :

{
"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"
}
}
When i do gulp tests from cmd then :

All test cases failing.
I'm seeing following error for each test case - ReferenceError: functionNameWhichIHaveSpyOn is not defined
After all test cases ran and failed, message in the bottom of cmd is there Error in plugin "gulp-jasmine"
But when i'm running same test cases using chutzpah in Visual Studio Test Explorer all test cases passed.

Please help me on this issue. Thanks in advance.

unit-testing gulp jasmine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions