Fork me on GitHub
#fulcro
<
2018-04-24
>
myguidingstar15:04:11

@parameme fyi the realworld api implementation is here https://github.com/walkable-server/realworld It's almost complete

fulcro 4
wilkerlucio15:04:22

@tony.kay had you done async testing with fulcro-spec? I'm doing some experimenting

wilkerlucio15:04:29

this works:

(deftest card-widget
  (async done
    (is (= 1 2))
    (done)))

wilkerlucio15:04:34

but this doesnt:

wilkerlucio15:04:43

(specification "card widget"
  (async done
    (is (= 1 2))
    (done)))

wilkerlucio15:04:54

(`async` is been pulled from cljs.test)

tony.kay15:04:59

I don’t introduce asynchrony into unit tests. I mock it out…so, no

wilkerlucio15:04:26

I want to do some interaction testing, and that will probably require some async things, because for mounting a fulcro app for example, I have to rely on a callback to know it's ready to use

tony.kay15:04:29

but not sure why it wouldn’t work…it is just a deftest…unless it works by somehow throwing special exceptions

wilkerlucio15:04:50

yeah, it seems like its been ignored or something, the test doesn't fail

tony.kay15:04:51

“some interaction testing”…in unit tests?

wilkerlucio15:04:11

I mean, testing in general, there is a mixed bag of things

tony.kay15:04:17

good luck…I’ve never gotten anything useful out of testing that way…just pain

wilkerlucio15:04:19

and I wanna experiment with interaction testing to see how it goes

tony.kay15:04:41

you’d have to dig into the source of async and see what it does…specification is a deftest whose body is wrapped for catching exceptions

tony.kay15:04:12

might be a special exception that needs to be let through?

wilkerlucio15:04:13

humm, I guess for now I'll just use deftest for those

wilkerlucio15:04:27

the async must be returning something special

wilkerlucio15:04:37

and by catching it might be breaking it?

tony.kay15:04:54

actually, it is asynchronous, so the reporting is probably happening after Fulcro spec’s collection has finished

wilkerlucio15:04:22

but fulcro uses same as cljs.test for flow right?

wilkerlucio15:04:31

also, I get correct reporting when using deftest

tony.kay15:04:46

you get correct reporting in the outline for fulcro spec?

wilkerlucio15:04:01

I'm not running there, I'm running in a karma terminal

wilkerlucio15:04:17

I'm in a half baked setup, so I'm running on console at this point

wilkerlucio15:04:26

but I think I can try that, let me check how it would go in the outline view

tony.kay15:04:29

so, Fulcro specification emits a deftest…it’s a small macro. don’t fear looking at the source. Fulcro’s runner just calls cljs.test run-all-tests with a regex

tony.kay15:04:02

the macros add in a few extra calls to reporting to make the outline nest and such

tony.kay15:04:19

but yes, it is meant to be just clj(s).test for compatibility

wilkerlucio16:04:54

@tony.kay just tested the async, the main outline fails, but the error is not shown =/