Skip to content

Commit

Permalink
improve testing stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelknoch committed Apr 9, 2016
1 parent ce12dbc commit bd60eef
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- 0.8
script:
- './node_modules/karma/bin/karma start karma.conf.js --single-run'
}
6 changes: 4 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ gulp.task('watch', ['build', 'web'], function () {
gulp.watch('app/**/*.html', ['html']);
});

gulp.task('test', function(done) {
gulp.task('test', ['build'], function (done) {
new KarmaServer({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, function() { done(); }).start();
}, function () {
done();
}).start();
});

gulp.task('build', ['html', 'ts', 'css']);
Expand Down
30 changes: 26 additions & 4 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function(config) {
module.exports = function (config) {
config.set({

basePath: '',
Expand All @@ -25,8 +25,8 @@ module.exports = function(config) {
// {pattern: 'app/**/*.css', included: false, watched: true},

// paths to support debugging with source maps in dev tools
// {pattern: 'app/**/*.ts', included: false, watched: false},
// {pattern: 'app/**/*.js.map', included: false, watched: false}
// {pattern: 'app/**/*.ts', included: false, watched: false},
// {pattern: 'app/**/*.js.map', included: false, watched: false}
],

// proxied base paths
Expand All @@ -35,12 +35,34 @@ module.exports = function(config) {
"/app/": "/base/app/"
},

reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],

// Karma plugins loaded
plugins: [
'karma-jasmine',
'karma-coverage',
'karma-chrome-launcher'
],

// Coverage reporter generates the coverage
reporters: ['progress', 'dots', 'coverage'],

// Source files that you wanna generate coverage for.
// Do not include tests or libraries (these files will be instrumented by Istanbul)
preprocessors: {
'dist/**/!(*spec).js': ['coverage']
},

coverageReporter: {
reporters: [
{type: 'json', subdir: '.', file: 'coverage-final.json'}
]
},

singleRun: true
})
}

0 comments on commit bd60eef

Please sign in to comment.