Add shadow-cljs test configuration

This commit is contained in:
Juho Teperi 2019-10-25 09:47:47 +03:00
parent 7a974ecccd
commit d663f3b53e
5 changed files with 32 additions and 1 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ reagent.iml
node_modules
junit
.shadow-cljs

View File

@ -15,6 +15,7 @@
"karma-chrome-launcher": "2.2.0",
"karma-cljs-test": "0.1.0",
"karma-junit-reporter": "1.2.0",
"md5-file": "4.0.0"
"md5-file": "4.0.0",
"shadow-cljs": "2.8.67"
}
}

9
shadow-cljs.edn Normal file
View File

@ -0,0 +1,9 @@
{:source-paths ["src" "test"]
:builds {:test {:target :karma
:output-to "target/shadow-cljs/resources/public/js/karma.js"
:output-dir "target/shadow-cljs/resources/public/js"
:asset-path "js"
:source-map true
:compiler-options {:infer-externs :auto}
:ns-regexp "(reagenttest\\.test.*|reagent\\..*-test)"}}
:dependencies []}

View File

@ -0,0 +1,15 @@
module.exports = function (config) {
config.set({
browsers: ['ChromeHeadless'],
basePath: '../../target/shadow-cljs/resources/public/js/',
files: ['karma.js'],
frameworks: ['cljs-test'],
plugins: ['karma-cljs-test', 'karma-chrome-launcher'],
colors: true,
logLevel: config.LOG_INFO,
client: {
args: ['shadow.test.karma.init'],
singleRun: true
}
});
};

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -ex
npx shadow-cljs release test
test -f target/shadow-cljs/resources/public/js/karma.js
karma start test-environments/shadow-cljs-prod/karma.conf.js --single-run