1
0
Эх сурвалжийг харах

test(rtc): add karma target

rcmerci 1 жил өмнө
parent
commit
98502d7cde
3 өөрчлөгдсөн 28 нэмэгдсэн , 1 устгасан
  1. 17 0
      karma.conf.js
  2. 4 1
      package.json
  3. 7 0
      shadow-cljs.edn

+ 17 - 0
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
+        }
+    })
+};

+ 4 - 1
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",

+ 7 - 0
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}