Name: gulp-jasmine-browser
Owner: AOE
Description: null
Created: 2015-04-22 07:16:04.0
Updated: 2015-04-22 07:16:05.0
Pushed: 2015-05-27 11:53:56.0
Homepage: null
Size: 132
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
gulp-jasmine-browser
is available as an
npm package.
In gulpfile.js
gulp = require('gulp');
jasmineBrowser = require('gulp-jasmine-browser');
.task('jasmine', function() {
turn gulp.src(['src/**/*.js', 'spec/**/*_spec.js'])
.pipe(jasmineBrowser.specRunner())
.pipe(jasmineBrowser.server());
In gulp.src
include all files you need for testing other than jasmine itself.
This should include your spec files, and may also include your production JavaScript and
CSS files.
In gulpfile.js
gulp = require('gulp');
jasmineBrowser = require('gulp-jasmine-browser');
.task('jasmine-phantom', function() {
turn gulp.src(['src/**/*.js', 'spec/**/*_spec.js'])
.pipe(jasmineBrowser.specRunner({console: true}))
.pipe(jasmineBrowser.phantomjs());
Note the {console: true}
passed into specRunner.
In gulpfile.js
gulp = require('gulp');
jasmineBrowser = require('gulp-jasmine-browser');
.task('jasmine-phantom', function() {
turn gulp.src(['src/**/*.js', 'spec/**/*_spec.js'])
.pipe(jasmineBrowser.specRunner({xml: true}))
.pipe(jasmineBrowser.phantomjs({xml: true, out: 'path/to/file.xml'}));
Note the {xml: true}
passed into specRunner and phantjomjs. With the {out: ''}
property you can decide where the output
shall be placed and how it shall be named (defaults to report.xml).
If you would like to compile your front end assets with Webpack, for example to use commonjs style require statements, you can pipe the compiled assets into GulpJasmineBrowser.
In gulpfile.js
gulp = require('gulp');
jasmineBrowser = require('gulp-jasmine-browser');
webpack = require('gulp-webpack');
.task('jasmine', function() {
turn gulp.src('spec/**/*_spec.js'])
.pipe(webpack({watch: true, output: {filename: 'spec.js'}}))
.pipe(jasmineBrowser.specRunner())
.pipe(jasmineBrowser.server());
The application requires the following external dependencies:
The rest of the dependencies are handled through:
install
Run tests with:
test
(c) Copyright 2015 Pivotal Software, Inc. All Rights Reserved.