mirror of
https://github.com/status-im/re-frame.git
synced 2025-02-23 15:28:09 +00:00
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.
26 lines
1021 B
JavaScript
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
|
|
}
|
|
})
|
|
};
|