node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



Use this plugin to run HTML spec files with Jasmine 2.0 specs. Currently, you must use this plugin in conjunction with the JUnitXmlReporter in jasmine2-junit. This reporter generates JUnit XML reports to be used in a CI build.

The plugin shows success/failure counts on the console. Specs will be run using PhantomJS 2.


In order to setup gulp-jasmine2-phantomjs, require the plugin and use gulp.src to pipe html spec files (see readme of for a correct setup of html files) into it:

var jasminePhantomJs = require('gulp-jasmine2-phantomjs');
var specFiles = '**/*.html';

gulp.task('test', function() {
    return gulp.src(specFiles).pipe(jasminePhantomJs());

If you want to pass additional arguments to PhantomJS, pass them as parameter to the plugin:

gulp.src(specFiles).pipe(jasminePhantomJs(['--web-security=false', '--load-images=false']));

Alternatively, if you just want to pass a single argument, you can use


An overview of available PhantomJS arguments can found here: