Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module.exports = function(config) {
var root = 'target/public/dev'// same as :output-dir
config.set({
frameworks: ['cljs-test'],
files: [
root + '/goog/base.js',
root + '/cljs_deps.js',
root + '/app.js',// same as :output-to
{pattern: root + '/*.js', included: false},
{pattern: root + '/**/*.js', included: false}
],
client: {
// main function
args: ['app.test_runner.run']
},
// singleRun set to false does not work!
singleRun: true,
// ------------------
// coverage
// ------------------
reporters: ['progress', 'coverage'],
coverageReporter: {
dir: 'target/coverage',
reporters: [
// cljs->js coverage (just in case you are curious as I am)
{type: 'html', subdir: 'report-html'},
// run
// ./node_modules/.bin/remap-istanbul -i target/coverage/report-json/coverage.json -o target/coverage/report-html-final -t html
// to generate cljs code coverage
{type: 'json', subdir: 'report-json', file: 'coverage.json'}
]
},
// collect coverage only for my code
// (as I'm not interested in goog, cljs, clojure, etc. namespaces/dirs)
preprocessors: {
'target/public/dev/<root_namespace>/**/*.js': ['coverage']
},
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment