Skip to content

Instantly share code, notes, and snippets.

@gexplorer
Created November 24, 2015 11:39
Show Gist options
  • Save gexplorer/9cdb7f090935c900f76a to your computer and use it in GitHub Desktop.
Save gexplorer/9cdb7f090935c900f76a to your computer and use it in GitHub Desktop.
NPM & bower dependencies for JavaScript testing
var gulp = require('gulp');
var Server = require('karma').Server;
gulp.task('test', function (done) {
new Server({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done).start();
});
gulp.task('tdd', function (done) {
new Server({
configFile: __dirname + '/karma.conf.js'
}, done).start();
});
module.exports = function (config) {
config.set({
basePath: 'www',
frameworks: ['jasmine'],
files: [
'js/**/*.js'
],
exclude: [],
preprocessors: {},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS'],
singleRun: false
})
};
{
"name": "JS Testing",
"version": "0.0.1",
"description": "Testing the night away",
"dependencies": {
"gulp": "^3.5.6"
},
"devDependencies": {
"bower": "^1.3.3",
"jasmine-core": "^2.3.4",
"karma": "^0.13.3",
"karma-cli": "^0.1.0",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.0",
"phantomjs": "^1.9.17"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment