Comments (6)
I've looked at this a little bit, and I'm not sure that I like the way Clojurescript One handles this. To me, the better solution would be to port the clojure.test
library to clojurescript, and to write the crossover tests using the subset of clojure.test
supported by both languages. As it stands, the Clojurescript One tests are a heavy mixture of Clojure and Clojurescript code, which is ugly, and would probably be a major turn-off for those people who plan to write 100% Clojurescript applications.
from lein-cljsbuild.
I agree with that, and I noticed your approach in supporting tests using assert
is a good middle ground. Probably a portable version of clojure.test
macros using assert
would be useful. I am personally experimenting with assert
– it appears something like the following in the ns
macro in test files might be required:
(:use;*CLJSBUILD-REMOVE*;-macros
[cljsbuild.test.macros;*CLJSBUILD-REMOVE*;-cljs
:only [deftest is is-thrown testing]])
from lein-cljsbuild.
Hmm, your example makes sense to me; the macros would definitely have to be imported differently for CLJ/CLJS. I think the CLJSBUILD-REMOVE feature would in fact work, but it's pretty ugly. I'm noodling around on other possibilities at the moment for how to accomplish that in a nicer way, but I don't have any great ideas so far.
from lein-cljsbuild.
I made some progress running regular clojure.test
tests in both Clojure and ClojureScript using the assert
technique shown in the cljsbuild examples. The form (is (= ...))
works fine, but (is (thrown-wih-msg? ...))
has some problem still, mainly due to regex match (project-specific issue). It's difficult to trace the error when tests fail, but it's a good start.
https://github.com/kumarshantanu/basil (master, lein jst cljsbuild test
)
from lein-cljsbuild.
I've factored out this idea (in a working form) into this library: https://github.com/kumarshantanu/clip-test
from lein-cljsbuild.
That's awesome. I'm going to close this case as it seems like you've taken care of it!
from lein-cljsbuild.
Related Issues (20)
- Custom tagged literals cause build failure HOT 1
- Fails on Java 9? HOT 2
- :asset-path isn't documented HOT 1
- Circular dependencies : Warn user when a namespace requires itself HOT 2
- Adding 'monger' dependency breaks cljsbuild. HOT 2
- Possibility to add cli options to closure compiler. HOT 2
- reload-clojure causes compilation failure in portable projects HOT 4
- Could not write JavaScript nil HOT 1
- Exception (...)/objectutil.js is not a relative path HOT 7
- Consider exposing :watch-fn compiler option? HOT 1
- :prep-tasks dont work when running `lein cljsbuild ...`
- Miraculously disappearing dependencies when using lein cljsbuild auto. HOT 2
- warning-handlers: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn HOT 2
- Duplicate input error HOT 1
- Recompiling compiled app with different optimization type
- Simple example project does not compile HOT 1
- `lein trampoline cljsbuild repl-rhino` fails with jdk 11 HOT 1
- cljsbuild-example-simple didnt run with lein 2.9.5 and Java version > 11 & 15 HOT 1
- cljsbuild cannot find reagent HOT 1
- Fails with ClojureScript newer than 1.10.764 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lein-cljsbuild.