diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000000..7cf8da86e6 --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,17 @@ +module.exports = function (config) { + config.set({ + browsers: ['Chrome'], + // The directory where the output file lives + basePath: 'static/rtc-e2e-test-karma', + // The file itself + files: ['main.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 + } + }) +}; diff --git a/package.json b/package.json index 90c35d5bd7..33e17353c5 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,10 @@ "stylelint-config-standard": "^20.0.0", "tailwindcss": "3.3.5", "tailwindcss-animate": "^1.0.7", - "typescript": "^4.4.3" + "typescript": "^4.4.3", + "karma": "^6.4.4", + "karma-chrome-launcher": "^3.2.0", + "karma-cljs-test": "^0.1.0" }, "scripts": { "watch": "run-p gulp:watch cljs:watch", diff --git a/shadow-cljs.edn b/shadow-cljs.edn index f5c18cd6ed..ead59314e1 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -102,6 +102,13 @@ :redef false} :cross-chunk-method-motion false :static-fns false}} + :rtc-e2e-test-karma {:target :karma + :closure-defines {frontend.worker.rtc.const/RTC-E2E-TEST* true} + :output-to "static/rtc-e2e-test-karma/main.js" + :compiler-options {:source-map true + :warnings {:fn-deprecated false + :redef false}}} + :gen-malli-kondo-config {:target :node-script :closure-defines {frontend.util/NODETEST true}