Fork me on GitHub
#cljs-dev
<
2019-03-05
>
borkdude17:03:06

related to that macro self-refer topic: this was the first time I had to explicitly :include-macros when requiring clojure.test. Other projects “just worked” without doing this. https://github.com/borkdude/finitize/blob/master/test/finitize/core_test.cljc#L4

borkdude17:03:13

The guide does tell to require it like:

(:require [cljs.test :refer-macros [deftest is testing run-tests]])
but I wonder why I never ran into this before

borkdude17:03:39

Maybe cljs.test should add self-requires too?

mfikes18:03:56

@borkdude I can't repro any failure. If I remove the explicit :include-macros, and I run the tests in a REPL, I get

Ran 1 tests containing 6 assertions.

borkdude18:03:22

weird. I got:

$ clj -A:test:cljs-test-runner

Testing finitize.core-test

ERROR in (finitize-test) (TypeError:NaN:NaN)
default
expected: (= 1 (finitize 1))
  actual: #object[TypeError TypeError: Cannot read property 'finitize' of undefined]

ERROR in (finitize-test) (TypeError:NaN:NaN)
default
expected: (= 1 (finitize 1 100))
  actual: #object[TypeError TypeError: Cannot read property 'finitize' of undefined]

borkdude18:03:29

I can try again in a minute

borkdude18:03:08

now it does work. no idea what this was, thanks for testing