gulp-qunit-harness
v1.0.3
Published
Gulp plugin for running qunit tests on a local machine and in the SauceLabs environment.
Downloads
666
Maintainers
Keywords
Readme
gulp-qunit-harness
Gulp plugin for qunit-harness
Install
$ npm install gulp-qunit-harness
Usage
var qunitHarness = require('gulp-qunit-harness');
var callbacks = require('./test/callbacks');
var CLIENT_TESTS_SETTINGS = {
basePath: './test/fixtures',
port: 2000,
crossDomainPort: 2001,
scripts: [
{ src: '/sources.js', path: './lib/index.js' },
{ src: '/before-test.js', path: './test/before-test.js' }
],
css: [ { src: 'style.css', path: './lib/style.css' } ],
configApp: require('./test/config-qunit-server-app'),
before: callbacks.before,
after: callbacks.after
};
var BROWSERS = [{
platform: 'Windows 10',
browserName: 'chrome'
}];
var SAUCELABS_SETTINGS = {
username: process.env.SAUCELABS_USERNAME,
accessKey: process.env.SAUCELABS_ACCESS_KEY,
build: process.env.TRAVIS_JOB_ID || '',
tags: [process.env.TRAVIS_BRANCH || 'master'],
browsers: BROWSERS,
name: 'qunit tests',
timeout: 300
};
gulp.task('tests', function () {
gulp
.src('./test/fixtures/**/*-test.js')
.pipe(qunitHarness(CLIENT_TESTS_SETTINGS));
});
gulp.task('tests-saucelabs', function () {
gulp
.src('./test/fixtures/**/*-test.js')
.pipe(qunitHarness(CLIENT_TESTS_SETTINGS, SAUCELABS_SETTINGS));
});