1.0.1 • Published 6 years ago

gulp-jasmine2-phantomjs v1.0.1

Weekly downloads
54
License
-
Repository
github
Last release
6 years ago

gulp-jasmine2-phantomjs

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.

Usage

In order to setup gulp-jasmine2-phantomjs, require the plugin and use gulp.src to pipe html spec files (see readme of https://github.com/sandermak/jasmine2-junit 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

gulp.src(specFiles).pipe(jasminePhantomJs('--web-security=false'));

An overview of available PhantomJS arguments can found here: http://phantomjs.org/api/command-line.html