Olical / cljs-test-runner

Discover and run your ClojureScript tests
https://clojars.org/olical/cljs-test-runner
The Unlicense
86 stars 16 forks source link

Doo not compatible with karma v6 #38

Open lread opened 3 years ago

lread commented 3 years ago

A small bug in doo causes karma v6 to fail.

After a PR for the fork of doo cljs-test-runner uses is applied and released we can update cljs-test-runner to reference new doo and all will be good.

Olical commented 3 years ago

So we just have to wait for that to be merged then I can update to that version of doo? Sounds good!

lread commented 3 years ago

Yes indeedy!

lread commented 3 years ago

Goodness gracious, the folks over at karma have temporarily reversed their strict parameter checking in v6.0.4.

Just the same, since the reversal is noted as temporary, we should probably still apply the v0.2.1 doo update.

Here's a way to reproduce the issue for karma v6.0.3

$ git clone https://github.com/Olical/cljs-test-runner.git
$ cd cljs-test-runner 

$ # sanity test
$ clojure -M:dev -m cljs-test-runner.main 

Testing example.partial-test

Testing example.yes-test

Ran 3 tests containing 3 assertions.
0 failures, 0 errors.

Add the following package.json to project root:

{
  "devDependencies": {
    "karma": "6.0.3",
    "karma-chrome-launcher": "^3.1.0",
    "karma-cljs-test": "^0.1.0"
  }
}

And then install necessary npm stuff:

$ npm install -g karma-cli
$ npm install

Node test should still pass:

$ clojure -M:dev -m cljs-test-runner.main --env node

Testing example.partial-test

Testing example.yes-test

Ran 3 tests containing 3 assertions.
0 failures, 0 errors.

But karma tests will fail:

$ clojure -M:dev -m cljs-test-runner.main --env chrome-headless
Karma - Spectacular Test Runner for JavaScript.

START - Start the server / do a single run.

Usage:
  karma start [configFile]

Positionals:
  configFile  Path to the Karma configuration file                      [string]

Options:
  --help                           Print usage and options.            [boolean]
  --port                           <integer> Port where the server is running.
  --auto-watch                     Auto watch source files and run on change.
  --detached                       Detach the server.
  --no-auto-watch                  Do not watch source files.
  --log-level                      <disable | error | warn | info | debug> Level
                                   of logging.
  --colors                         Use colors when reporting and printing logs.
  --no-colors                      Do not use colors when reporting or printing
                                   logs.
  --reporters                      List of reporters (available: dots, progress,
                                   junit, growl, coverage).
  --browsers                       List of browsers to start (eg. --browsers
                                   Chrome,ChromeCanary,Firefox).
  --capture-timeout                <integer> Kill browser if does not capture in
                                   given time [ms].
  --single-run                     Run the test when browsers captured and exit.
  --no-single-run                  Disable single-run.
  --report-slower-than             <integer> Report tests that are slower than
                                   given time [ms].
  --fail-on-empty-test-suite       Fail on empty test suite.
  --no-fail-on-empty-test-suite    Do not fail on empty test suite.
  --fail-on-failing-test-suite     Fail on failing test suite.
  --no-fail-on-failing-test-suite  Do not fail on failing test suite.
  --format-error                   A path to a file that exports the format
                                   function.                            [string]

Unknown argument: cljs-test-runner-out/cljs_test_runner.gen.js

When I update cljs-test-runner to point to doo v0.2.1, chrome-headless passes:

$ clojure -M:dev -m cljs-test-runner.main --env chrome-headless
Downloading: ingesolvoll/doo/0.2.1/doo-0.2.1.pom from clojars
Downloading: ingesolvoll/doo/0.2.1/doo-0.2.1.jar from clojars
02 02 2021 11:41:35.883:WARN [web-server]: 404: /cljs-test-runner-out/goog/deps.js
02 02 2021 11:41:35.889:WARN [web-server]: 404: /cljs-test-runner-out/cljs_deps.js
LOG: 'Testing example.partial-test'
LOG: 'Testing example.yes-test'
Chrome Headless 88.0.4324.96 (Mac OS 10.15.7): Executed 3 of 3 SUCCESS (0.019 secs / 0.002 secs)
TOTAL: 3 SUCCESS

And node still passes:

$ clojure -M:dev -m cljs-test-runner.main --env node           

Testing example.partial-test

Testing example.yes-test

Ran 3 tests containing 3 assertions.
0 failures, 0 errors.