This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-16
Channels
- # announcements (1)
- # aws (1)
- # babashka (14)
- # beginners (25)
- # biff (5)
- # calva (6)
- # clj-kondo (3)
- # cljsrn (7)
- # clojars (7)
- # clojure (26)
- # clojure-europe (13)
- # clojurescript (10)
- # code-reviews (1)
- # cursive (9)
- # datahike (3)
- # datomic (7)
- # depstar (5)
- # emacs (9)
- # garden (2)
- # graalvm (1)
- # helix (3)
- # jobs (1)
- # leiningen (2)
- # off-topic (1)
- # pathom (3)
- # re-frame (16)
- # reitit (3)
- # releases (1)
- # shadow-cljs (10)
- # spacemacs (6)
- # tools-deps (16)
hello, I'm trying to run tests with karma
and I get this error:
user:shadow-quagga$ yarn karma start --single-run
yarn run v1.21.1
$ /home/user/work/node_modules/.bin/karma start --single-run
16 05 2021 09:13:28.366:INFO [karma-server]: Karma v6.3.2 server started at
16 05 2021 09:13:28.367:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
16 05 2021 09:13:28.371:INFO [launcher]: Starting browser ChromeHeadless
16 05 2021 09:13:28.623:INFO [Chrome Headless 90.0.4430.212 (Linux x86_64)]: Connected on socket BOp0uUsEZlSbo7HdAAAB with id 30514711
Chrome Headless 90.0.4430.212 (Linux x86_64) ERROR
ReferenceError: test is not defined
at eval (eval at <anonymous> (/home/user/work/zebra/shadow-quagga/node_modules/karma-cljs-test/adapter.js:6:7), <anonymous>:1:15)
at ContextKarma.start (/home/user/work/zebra/shadow-quagga/node_modules/karma-cljs-test/adapter.js:6:7)
at ContextKarma.loaded ()
at
not sure what I'm missing... I have a test build that looks like this
:ci {:target :karma
:output-to "out/ci.js"
:ns-regexp "-test$"}
my karma.conf.js
looks like this
// See
module.exports = function(config) {
config.set({
frameworks: ['cljs-test'],
plugins: ['karma-cljs-test', 'karma-chrome-launcher', 'karma-junit-reporter'],
basePath: 'out',
// If you need to include custom JavaScript files, put them here.
files: [
// We serve all the JS files via Karma's webserver so that you can
// use :optimizations :none. Only test_suite.js is included because
// CLJS does its own module loading.
'ci.js'
],
colors: true,
logLevel: config.LOG_INFO,
client: {
args: ['quagga.runner-test.run'],
singleRun: true
},
// If you don't like the progress reporter, you could try 'dots'
reporters: ['progress', 'junit'],
// If you want to use other browsers, you need to install the launchers
// for them! E.g. npm install --save-dev karma-firefofx-launcher
browsers: ['ChromeHeadless'],
reportSlowerThan: 500, // ms
// We disable autoWatch, because it executes tests while the code is
// still comiling. We use :notify-command to trigger them instead.
autoWatch: false,
// Configuration for JUnit output. We care only about the output directory.
// This directory is relative to basePath, so the XML files will be
// in `target/out/reports`.
// <>
junitReporter: {
outputDir: 'reports'
}
});
}
in the quagga.runner-test
namespace I have a run function that looks like this
(defn ^:export run [karma]
(karma/run-tests
karma
'quagga.events-test))
an in the quagga.events-test
namespace
(ns quagga.events-test
(:require [cljs.test :refer-macros [deftest is testing run-tests]]))
(deftest first-test
(testing "hello world test"
(is (= 1 1))))