javascript - Using Jasmine Ajax -


i writing tests jasmine. running tests via gulp. want use jasmine ajax plugin. however, cannot figure out how include tests. right now, have following:

tests.js

describe('myapp', function() {   beforeeach(function() {     jasmine.ajax.install();   });    it('should run ajax request', function() {     // test ajax   }); }); 

once again, i'm running via gulp. so, in gulpfile.js have following:

gulpfile.js

var gulp = require('gulp'); var jasmine = require('gulp-jasmine');  gulp.task('test', function() {   return gulp     .src('tests/*.js')     .pipe(jasmine()); }); 

when execute this, following command-line:

typeerror: cannot read property 'install' of undefined.

its jasmine ajax isn't getting loaded. yet, i'm not sure how load it. can please me solve issue?

thank you.

i haven't tested myself since don't have enough info recreate setup, try put mock-ajax.js file in helpers directory, default configuration of jasmine-npm, used gulp-jasmine, looks them.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -