Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Humane test optput #9

Closed
wants to merge 4 commits into from

Conversation

nenadalm
Copy link

No description provided.

@@ -62,6 +63,7 @@
(karma-result! result)))

(defmethod cljs.test/report [::karma :fail] [m]
(println m)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to contain correct map now (#8 (comment))

@nenadalm
Copy link
Author

This pr just contains initial work - I'll probably continue on the weekend

@honzabrecka
Copy link
Owner

Great! Thank you. I'm just working on diff prototype https://github.com/honzabrecka/karma-reporter/tree/diff

You can try with:

(deftest failing-test
  (is (= (inc 1) (inc 2) (inc 3)))
  (is (= {:x [4] :a [1 3]}
         {:a [1 2] :y [6] :x [4]}))
  (is (true? (= true false)) "Whoops!")
  (is (= (range 30) (range 1 50)) (str "Let me add in something\nfancy here: " {:a 1234}))
  (is (> 1 2)))

@nenadalm
Copy link
Author

so... now it works, except the output is not very nice

$ ./node_modules/.bin/karma start config/run-all.conf.js
26 11 2016 09:45:47.118:WARN [web-server]: 404: /test/cljs_deps.js
..
LOG: '
FAIL in (map-test) (pjstadig.macro.do_report.cljs$core$IFn$_invoke$arity$variadic@http:57:8)'
LOG: ''
LOG: 'expected: {:a "a", :b "b"}
  actual: {:a "b", :b "b"}
'
LOG: '    diff: - {:a "a"}
          + {:a "b"}
'
Firefox 50.0.0 (Fedora 0.0.0) foo.bar-test map-test FAILED
	
Firefox 50.0.0 (Fedora 0.0.0): Executed 3 of 3 (1 FAILED) (0.209 secs / 0.01 secs)

because report- function doesn't return string, but does printing... I'll check what to do about this (probably pr to https://github.com/pjstadig/humane-test-output where report- will call some function which will return string and then it'll print it - we could than use the function returning the string instead of calling report-)

@nenadalm nenadalm changed the title [wip] Humane test optput Humane test optput Nov 26, 2016
@nenadalm
Copy link
Author

it seems that with-out-str did the trick (I am not very experienced with clojure[script]). Is it mergeable now?

@honzabrecka
Copy link
Owner

Thank you for your work, but I decided to came up with custom output/diff format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants