Created
May 6, 2016 18:31
-
-
Save rssilva/5c2b8901237f6051c09ca9194aa6ea01 to your computer and use it in GitHub Desktop.
Writing tests using Jasmine with Browserify, Babel and generating coverage with Istanbul
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const istanbul = require( 'browserify-istanbul' ) | |
module.exports = function(config) { | |
config.set({ | |
basePath: '', | |
frameworks: ['browserify', 'jasmine'], | |
files: [ | |
// 'js/**/*.js', | |
'js/utils/**/*.js', | |
'test/spec/*.js' | |
], | |
exclude: [ | |
'js/app.js', 'js/utils/*.js' | |
], | |
preprocessors: { | |
'test/spec/*.js': [ 'browserify' ], | |
'js/**/*.js': ['browserify', 'coverage'] | |
}, | |
reporters: ['dots', 'coverage'], | |
coverageReporter: { | |
dir: './test/coverage', | |
reporters: [ | |
{ type: 'html', subdir: '.' }, | |
{ type: 'text', subdir: '.', file: 'text.txt' }, | |
] | |
}, | |
browserify: { | |
debug: true, | |
bundleDelay: 1000, | |
extensions: [ '.js' ], | |
transform: [ | |
'babelify', | |
istanbul( { | |
// ignore: [ '**/spec/**', '**/fixture/**' ] | |
} ) | |
] | |
}, | |
// port: 9876, | |
colors: true, | |
logLevel: config.LOG_INFO, | |
autoWatch: false, | |
browsers: ['Chrome'], | |
singleRun: true | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment