eftest icon indicating copy to clipboard operation
eftest copied to clipboard

Report doesn't print a diff when used with Ultra

Open LukasRychtecky opened this issue 6 years ago • 2 comments

Actual:

FAIL in foo-test/bar-test (foo_test.clj:10)
expected: {:a 0, :b 1}
  actual: ({:b 1, :c 2})

Expected:

FAIL in foo-test/bar-test (foo_test.clj:10)
expected: {:a 0, :b 1}
  actual: {:b 1, :c 2}

    diff: - {:a 0}
          + {:c 2}

LukasRychtecky avatar Mar 11 '19 19:03 LukasRychtecky

I've tried reproducing this with the following test namespace:

(ns foo.core-test
  (:require [clojure.test :refer :all]
            [foo.core :refer :all]))

(deftest a-test
  (is (= {:a 0, :b 1} {:b 1, :c 2})))

And running lein eftest with Eftest 0.5.7 produces:


FAIL in foo.core-test/a-test (core_test.clj:6)
expected: {:a 0, :b 1}
  actual: {:b 1, :c 2}
    diff: - {:a 0}
          + {:c 2}

1/1   100% [==================================================]  ETA: 00:00

Ran 1 tests in 0.038 seconds
1 assertion, 1 failure, 0 errors.
Tests failed.

My guess is that you have a Leiningen plugin that's altering the test reporting. Maybe it's erroneously wrapping the actual value in a list.

weavejester avatar Mar 12 '19 20:03 weavejester

This looks like an issue caused by Ultra, which changes the reporting format for equality assertions. Ideally Ultra shouldn't change the reporting format used by clojure.test, otherwise third-party test reporters won't work if the Ultra plugin is included.

weavejester avatar Mar 13 '19 19:03 weavejester