Questions tagged [gulp-jasmine]

a gulp plugin for running Jasmine 2.x tests.

gulp-jasmine is a gulp plugin for running Jasmine 2.x tests.

Usage example:

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

gulp.task('default', function () {
  return gulp.src('spec/my-favorite-test.js')
    .pipe(jasmine());
});
14 questions
12
votes
2 answers

gulp-jasmine Window is not defined error

I am using gulp / gulp-jasmine / angular to run my unit tests. However, I encounter the following error when running my Gulp target: C:\Projects\website2>gulp test [01:53:10] Using gulpfile C:\Projects\website2\gulpfile.js [01:53:10] Starting…
Michael Kang
  • 52,003
  • 16
  • 103
  • 135
9
votes
1 answer

Specifying dependencies with gulp-jasmine

I have the following gulpfile.js: var gulp = require('gulp'), jasmine = require('gulp-jasmine'); gulp.task('default', function () { return gulp .src('spec/test.js') .pipe(jasmine()); }); The code inside spec/test.js uses a…
FOO
  • 612
  • 5
  • 16
4
votes
3 answers

jasmine with gulp, run tests on test file changed

Hi what I trying to do is to make watcher task with gulp which will run my jasmine tests. What I have done so far: var watch = require("gulp-watch"); var jasmine = require("gulp-jasmine"); gulp.task('tests.run.change-watcher', function (cb) { …
Maris
  • 4,608
  • 6
  • 39
  • 68
2
votes
1 answer

what is the reason of " events.js:174 throw er; // Unhandled 'error' event " gulp error message?

I'm tryig to write a code that test another functionality code using jasmine testing framework and gulp But i'm new in the Gulp field and i'm encountering the following issue my code is : /*eslint-env node */ const gulp = require('gulp'); const…
Dani Mousa
  • 93
  • 9
2
votes
1 answer

Testing with gulp + babel + jasmine on nodejs

I am trying to test my code with gulp-jasmine and gulp-babel: var gulp = require("gulp"), jasmine = require("gulp-jasmine"), babel = require("gulp-babel"); module.exports = function () { gulp.src(["index.js", "src/**/*.js",…
inf3rno
  • 24,976
  • 11
  • 115
  • 197
2
votes
0 answers

Cannot find module in jasmine spcs with gulp and browserify

I am setting up gulp/jasmine with a project running with browserify. I am using absolute paths to load modules. E.g. modules/deposit/card When I want to load this module in my spec file to test it with jasmine, I am getting an error: Cannot find…
user2814599
  • 1,060
  • 1
  • 13
  • 27
2
votes
3 answers

Continuous Integration: Codeship + Gulp (Jasmine)

My Continuous Integration works pretty great using Codeship except one thing: stop deploying and alert us when unit tests are failing. Here is our current commands: npm install npm install bower bower install gulp test gulp build The problem is…
MaximeBernard
  • 1,090
  • 1
  • 19
  • 33
1
vote
0 answers

How to run Jasmine specs from Gulpfile.js when i need spy.js and mock-ajax.js file in jasmine specs

My Folder Structure is as below: Root |- Scripts |- ViewScripts |- Feature_1 |- feature_1.js |- Jasmine |- Helpers |- jasmine.js |- Spy.js |- mock-ajax.js |-…
1
vote
1 answer

Jasmine Open And Close Db Connections

I have multiple files with unit tests. I want to avoid to concat them. I need to close the mongoose connection in order for gulp-jasmine to exit. I also want to avoid to put the connection handling into an it block, because it wouldn't belong…
Andi Giga
  • 3,744
  • 9
  • 38
  • 68
1
vote
2 answers

Testing Express / Passport middleware using Jasmine — passport.authenticate never completes

I'm trying to unit test a simple piece of Express middleware, a cascading athenticator that checks first for a JWT token using a passport-jwt-strategy, and then if that fails, using a passport-openid-strategy. Each of the strategies is already well…
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
1
vote
1 answer

Jasmine - Using a Custom Reporter

I am testing some JavaScript with Jasmine via Gulp. I want to create my own reporter. At this time, my reporter is as basic as it gets. It looks like this: 'use strict'; var myCustomReporter = { jasmineStarted: function(suiteInfo) { …
user70192
  • 13,786
  • 51
  • 160
  • 240
0
votes
1 answer

Where can i mention source js files that needs to be tested in gulp-jasmine?

Here is what i am using as of now. gulp.task('test', function () { return gulp.src([ './app/spec/*.js']) .pipe(jasmine()); }); But in case of grunt, you can mention source files like this jasmine: { src: 'js/**/*.js', …
Ankur Marwaha
  • 1,613
  • 2
  • 15
  • 30
0
votes
1 answer

Jasmine expected spy function to have been called on backbone.view

I am having trouble understanding spies with my jasmine tests. When I run the below test I can see the output CLOSE EVENT in my console, but the test triggers close fails. How do I write the test correctly using spies? define([ 'backbone' ],…
minlare
  • 2,454
  • 25
  • 46
0
votes
1 answer

gulp-jasmine gives error with systemjs

--- UPDATE --- So I updated my task and now I have the following, the problem is that when it gets into the spec the first line is the following import {Injector, provide} from "angular2/core"; Unfortunately this is not referencing the…
HeavenlyHost
  • 75
  • 2
  • 11