1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-03 17:59:28 +02:00

Karma now works from Gulp.

This commit is contained in:
Gunther Brunner 2014-08-20 20:58:49 +09:00
parent 14ddd14b47
commit f2c00ce016
3 changed files with 15 additions and 16 deletions

View file

@ -12,10 +12,8 @@ var clean = require('gulp-clean')
var protractor = require("gulp-protractor")
var protractorConfig = require('./res/test/protractor.conf.js')
var karma = require('karma').server
var karmaConfig = require('./res/test/karma.conf.js')
var karmaConfig = '/res/test/karma.conf.js'
var stream = require('stream')
var _ = require('lodash')
gulp.task('jshint', function () {
return gulp.src([
@ -45,12 +43,17 @@ gulp.task('lint', ['jshint', 'jsonlint'])
gulp.task('test', ['lint', 'protractor'])
gulp.task('build', ['translate', 'webpack:build'])
gulp.task('karma', function (done) {
karma.start(_.assign({}, karmaConfig, {singleRun: true}), done)
gulp.task('karma_ci', function (done) {
karma.start({
configFile: __dirname + karmaConfig,
singleRun: true
}, done)
})
gulp.task('karma_watch', function (done) {
karma.start(karmaConfig, done)
gulp.task('karma', function (done) {
karma.start({
configFile: __dirname + karmaConfig
}, done)
})
gulp.task('webdriver_update', protractor.webdriver_update)

View file

@ -1,10 +1,11 @@
describe('greeter', function () {
function greet(str) {
return 'Helloaw, ' + str
return 'Hello, ' + str
}
it('should say Hello to the World', function () {
expect(greet('World')).toEqual('Hello, World!')
expect(greet('World!')).toEqual('Hello, World!')
})
})

View file

@ -1,21 +1,16 @@
// Karma configuration
module.exports = function (config) {
config.set({
// base path, that will be used to resolve files and exclude
//basePath: '',
frameworks: ['jasmine'],
files: [
//'test/*Test.*'
'../app/*-test.js'
// '../app/**/*.js'
],
exclude: [
],
preprocessors: {
// '../app/**/*.js': ['webpack']
'../app/*-test.js': ['webpack']
},