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; > > > <https://lh3.googleusercontent.com/-Vq1BC6y50cM/WiUExdX1SZI/AAAAAAAAGWg/kTMzig4RYHU2PWStfXZkKAhJCSAeqLv5wCEwYBhgL/s1600/Screen%2BShot%2B2017-12-04%2Bat%2B05.12.45.png> > > And the browser looks as follows with a failure; > > > > <https://lh3.googleusercontent.com/-AFiBKq-n--U/WiUFMRy7NII/AAAAAAAAGWk/SHOqxGH2ykoAxYJsHjlbOUbbrtWjAKUAwCLcBGAs/s1600/Screen%2BShot%2B2017-12-04%2Bat%2B05.13.07.png> > > 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/clojurescript.
