News for hackers. Stuff that matters.
Re:Ava – Asynchronous test runner by tzaman on Wednesday November 25, 2015 @06:17PM (#10630425)
Pretty amazing, but there's one feature all test runners seem to ignore, and that's persistent watching. And the ones that _do_ support it just run pretty much _everything_ on each save.

My development process looks like this:

- run the watcher

- save a source/test file

- if the file is in /test/ dir, then the suite is ran

- if the file is in /src/ dir, then it is instrumented (and the instrumented source replaces require cache

- once the suite is done running, a coverage report (Istanbul ftw!) is built both in html and console versions.e

- Every save only takes a few milliseconds to generate the feedback/output, which is really important to me

It took some time, but got it working eventually: https://medium.com/@TomazZaman/how-to-get-fast-unit-tests-wi...

Now the question I have at this point is: Is it only me who has this kind of requirements? Because I've Googled a lot (A-LOT!) and there's simply no Javascript test optimization techniques out there. At least none people would write about.

Re:Ava – Asynchronous test runner by mofle on Wednesday November 25, 2015 @11:08PM (#10631216)
AVA author here. Not ignored, just not implemented yet. AVA is still in its infancy and we're prioritizing getting the core settled first. We're are thinking of doing something even more ambitious, though. Naive watching is easy, but we want to tackle incremental testing, so you only have to run the tests that was affected by code changes since the last run. See https://github.com/sindresorhus/ava/issues/115 for more.

We're happy to receive issues if there's anything else that bothers you. We also have a Gitter chat if you'd like to discuss: https://gitter.im/sindresorhus/ava :)

Re:Ava – Asynchronous test runner by tzaman on Thursday November 26, 2015 @10:03AM (#10633188)
Thanks! I'll look this project closely from now on and try to contribute to best of my abilities! :)
Re:Ava – Asynchronous test runner by bookerio on Wednesday November 25, 2015 @06:40PM (#10630506)
There is an open issue regarding this: https://github.com/sindresorhus/ava/issues/115

In the meantime, there's Wallaby: http://wallabyjs.com/

Re:Ava – Asynchronous test runner by sjrd on Wednesday November 25, 2015 @07:32PM (#10630676)
Scala.js with sbt supports persistent watching with running only what actually changed. And it runs tests in parallel by default. And that works for all testing frameworks. Oh and most testing frameworks support asynchronous tests (what ava calls "Planned assertions").

One command: "sbt ~testQuick".

Re:Ava – Asynchronous test runner by wallabyjs on Thursday November 26, 2015 @12:01AM (#10631361)
Wallaby.js author here. Just thought I'd mention that we are working on AVA and tape support in wallaby: https://github.com/sindresorhus/ava/issues/141
Re:Ava – Asynchronous test runner by jamestalmage on Wednesday November 25, 2015 @11:29PM (#10631275)
Another member of the AVA team here. As Sindre said, watch is certainly on our radar. But so is speed. We have every intention of optimizing which tests run and delivering feedback within milliseconds. Someday soon, I hope the answer to Javascript test optimization is "use AVA".
Re:Ava – Asynchronous test runner by joshschreuder on Wednesday November 25, 2015 @11:22PM (#10631252)
It's called continuous testing.

As mentioned below, Wallaby.JS does it for Javascript, and on the .NET side at least there's NCrunch [1] and recently Resharper added their own take on it [2]

[1] http://ncrunch.net

[2] https://blog.jetbrains.com/dotnet/2015/09/01/resharper-10-ea...

Re:Ava – Asynchronous test runner by aclatuts on Wednesday November 25, 2015 @10:25PM (#10631092)
You should use a task runner there are libraries for gulp and grunt.

https://github.com/sindresorhus/gulp-ava https://github.com/sindresorhus/grunt-ava

Re:Ava – Asynchronous test runner by ericclemmons on Thursday November 26, 2015 @12:29AM (#10631436)
I'm 100% with you.

Using Webpack and Mocha, I run `npm test:watch -- test/some/thing.js` which builds just that test's bundle and runs it with Mocha. If there's a change, the bundle is refreshed and Mocha reruns it.

It took more effort to accomplish than I would like, but I didn't find any alternatives at the time for Webpack users.