[ClojureScript] Re: TDD + figwheel + desktop notifications

2017-12-04 Thread Christopher Small
FWIW, I think the criticism around TDD in the Clojure(script) community is 
not so much that testing first is bad, but that writing tests without first 
thinking through and understanding your problem is bad. I think some have 
extended this to a blanket "TDD bad!" battlecry, but this I think misses 
much of the nuance of the critique that Rich Hickey and others have made.

More to the point of your post, cool work!

Chris


On Monday, December 4, 2017 at 12:35:36 AM UTC-8, Nathan Fisher wrote:
>
> Hi All,
>
>
> I know TDD carries a bit of a stigma in the Clojure(script) community but 
> I find it valuable. I thought I'd share my test harness for local 
> development so others could use it/comment on it.
>
> The main benefit I see to this test harness is;
>
>1. it's quick as figwheel is.
>2. it has desktop notifications.
>3. it uses vanilla cljs.test/deftest and cljs.test/run-all-tests 
>rather than another macro.
>
>
> I plan to write up a blog post on it but you can try it by doing the 
> following;
>
>1. clone https://github.com/nfisher/lein-nashtest.
>2. lein figwheel.
>3. browse to http://0.0.0.0:3449/test.html.
>4. accept notifications.
>5. cause the test to fail in cljs/jbx/pants_test.cljs.
>6. fix the test and see a passing notification.
>
> The failure notification looks as follows;
>
>
> 
>
> And the browser looks as follows with a failure;
>
>
>
> 
>
> Looking under the hood you'll see it's a bit hack-ish essentially there's 
> two bits to it;
>
>
>1. figwheels :js-onload.
>2. overriding console.log and taking actions on particular values. 
>Using the cljs.test/report multi-method would probably be a better 
> approach 
>long-term.
>
> If you wanted to use the test harness in your own project you can simply 
> add a cljsbuild target similar to figtest in my projects build and copy 
> test.html into your $project/resources/public folder.
>
> Cheers!
> Nathan
>
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: TDD + figwheel + desktop notifications

2017-12-04 Thread Phill Wolf
That is a neat trick!  

(But if I did TDD on a web server, the very first test would be "it's not 
listening to 0.0.0.0", which, evidently, browsing to 0.0.0.0 is not a test 
of.)

;-)

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: ClosureScript Quick Start error on Windows

2017-12-04 Thread Thomas Heller
This is a Java9 error. It was fixed recently but has not been released yet.

You can either add "--add-modules java.xml.bind" to the java cmd arguments 
or downgrade to Java 8.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] TDD + figwheel + desktop notifications

2017-12-04 Thread Nathan Fisher


Hi All,


I know TDD carries a bit of a stigma in the Clojure(script) community but I 
find it valuable. I thought I'd share my test harness for local development 
so others could use it/comment on it.

The main benefit I see to this test harness is;

   1. it's quick as figwheel is.
   2. it has desktop notifications.
   3. it uses vanilla cljs.test/deftest and cljs.test/run-all-tests rather 
   than another macro.


I plan to write up a blog post on it but you can try it by doing the 
following;

   1. clone https://github.com/nfisher/lein-nashtest.
   2. lein figwheel.
   3. browse to http://0.0.0.0:3449/test.html.
   4. accept notifications.
   5. cause the test to fail in cljs/jbx/pants_test.cljs.
   6. fix the test and see a passing notification.

The failure notification looks as follows;



And the browser looks as follows with a failure;




Looking under the hood you'll see it's a bit hack-ish essentially there's 
two bits to it;


   1. figwheels :js-onload.
   2. overriding console.log and taking actions on particular values. Using 
   the cljs.test/report multi-method would probably be a better approach 
   long-term.
   
If you wanted to use the test harness in your own project you can simply 
add a cljsbuild target similar to figtest in my projects build and copy 
test.html into your $project/resources/public folder.

Cheers!
Nathan

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.