re-frame/karma.conf.js
Daniel Compton 87fccd10a3 Fix karma.conf.js to only watch test.js
Karma was previously configured to watch all of the files in the pattern
which meant that any time those files changed (the autobuilder copies
them over), it triggered a rerun. This was usually before the test file
was ready to run, which caused test failures or other glitches.

This commit fixes the Karma config so that autorun test only run when
compilation has finished.
2016-12-12 15:42:45 +13:00

26 lines
1021 B
JavaScript

module.exports = function (config) {
var root = 'run/compiled/karma/test'; // same as :output-dir
var junitOutputDir = process.env.CIRCLE_TEST_REPORTS || "run/compiled/karma/test/junit";
config.set({
frameworks: ['cljs-test'],
browsers: ['Chrome'],
files: [
root + '/../test.js', // same as :output-to
{pattern: root + '/../test.js.map', included: false, watched: false},
{pattern: root + '/**/*.+(cljs|cljc|clj|js|js.map)', included: false, watched: false}
],
client: {
args: ['re_frame.test_runner.run_karma']
},
// the default configuration
junitReporter: {
outputDir: junitOutputDir + '/karma', // results will be saved as $outputDir/$browserName.xml
outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: '' // suite will become the package name attribute in xml testsuite element
}
})
};