Giter VIP home page Giter VIP logo

fulcro-spec's People

Contributors

awkay avatar egracer avatar jasonjckn avatar jdslavin avatar miguelsm avatar pancia avatar wilkerlucio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fulcro-spec's Issues

assertions macro takes exponential time to compile


;; 3 assertions
user=> (do (time (macroexpand-1 '(c/assertions "hello" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3))) :ok)
"Elapsed time: 1.66508 msecs"
:ok

;; 6 assertions
user=> (do (time (macroexpand-1 '(c/assertions "hello" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "bye" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3))) :ok)
"Elapsed time: 7.626273 msecs"
:ok

;; 9 assertions
user=> (do (time (macroexpand-1 '(c/assertions "hello" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "bye" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "adieu" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3))) :ok)
"Elapsed time: 26.759702 msecs"
:ok

;; 12 assertions
user=> (do (time (macroexpand-1 '(c/assertions "hello" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "bye" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "adieu" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "qwerty" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3))) :ok)
"Elapsed time: 91.719407 msecs"
:ok

;; 24 assertions
user=> (do (time (macroexpand-1 '(c/assertions "hello" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "bye" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "adieu" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "qwerty" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "hello" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "bye" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "adieu" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3 "qwerty" (inc 0) => 1 (inc 1) => 2 (inc 2) => 3))) :ok)
"Elapsed time: 14398.550569 msecs"
:ok

BUG: Browser renderer "focused" is lost when server test fails

Steps to reproduce:

  1. Run server tests via browser renderer
  2. Set selectors to just focused
  3. Make a non-focused test fail
  4. Fix the test

When a test fails, it starts showing all tests (at least for the failing ns). Once the test is fixed it still shows the non-focused ones.

Server test runner causing flapping?

So, when I'm working on SS tests on fulcro and rendering with browser, periodically on save I'll see the tests in core_spec.clj fail. Saving again causes them to succeed. My guess is that a refresh might be happening when a re-run gets triggered?

fulcro-report reports twice the number of failures / oks

The fulcro-report reports twice the number of assertions.

Example:

(deftest foo
  (is false))

default koacha reporter

1 tests, 1 assertions, 1 failures.

fulcro-spec.reporters.terminal/fulcro-report:

Ran 1 tests containing 2 assertions.
2 failures, 0 errors.

Same for assertions that do not fail.

Noisy runs

Hi!

I see the following when running (clojure.test/run-all-tests #"(foo)\..*") in-repl:

image

Seems an unnecessary output. Is it possible to disable it?

Using fulcrologic/fulcro-spec "2.0.2-1".

Thanks - Victor

clojure.test.check fails together with fulcro-spec

When I try to use the fulcro-spec server stuff to run them in the browser, I used to get weird errors which would say Could not find cloure.test.check.clojure-test after some digging around I found the followin exception (which explains the error above).

17-08-25 13:27:30 mitsel ERROR [fulcro.server:276] - #:fulcro-spec.selectors{set-active-selectors #:om.next{:error java.lang.ClassCastException: fulcro_spec.reporter$fulcro_report$fn__66506 cannot be cast to clojure.lang.MultiFn, compiling:(clojure/test/check/clojure_test.cljc:119:1)}} Parser error:
 {:status 400,
 :body
 #:fulcro-spec.selectors{set-active-selectors
                         #:om.next{:error
                                   {:type
                                    "class clojure.lang.Compiler$CompilerException",
                                    :message
                                    "java.lang.ClassCastException: fulcro_spec.reporter$fulcro_report$fn__66506 cannot be cast to clojure.lang.MultiFn, compiling:(clojure/test/check/clojure_test.cljc:119:1)"}}}}

I found this code in clojure.test.check

(let [begin-test-var-method (get-method ct/report #?(:clj  :begin-test-var
                                                     :cljs [::ct/default :begin-test-var]))]
  (defmethod ct/report #?(:clj  :begin-test-var
                          :cljs [::ct/default :begin-test-var]) [m]
    (reset! last-trial-report (get-current-time-millis))
    (when begin-test-var-method (begin-test-var-method m))))

It seems to expect a multimethod. Would you accept a pull request that fixes this?

Incompatible event key :expected for clojure.test/report

clojure.test reporters depend on an event map to pretty-print failures. For an assertion that macro-expands to (is (= :foo :bar)), Fulcro Spec is returning {:expected :foo} instead of {:expected '(= :foo :bar)}. This is a problem for any reporters that do not just print the error, but try to analyze it further (e.g. Kaocha that tries to pretty-print data diffs).

More details:

https://github.com/clojure/clojure/blob/28efe345d5e995dc152a0286fb0be81443a0d9ac/src/clj/clojure/test.clj#L221

https://github.com/lambdaisland/kaocha/blob/ac234e866e81514313beaa8da917665e99cd1b65/src/kaocha/report.clj#L215-L220

Maybe a workaround is to return the full expression in :expected and use a different key for the expected-value that is used by the Fulcro reporters?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.