3 ms·
So, how do you write your unit tests? Within grails and guard (and other systems as well), I save my file and I have all the relevant unit tests running immedia
by ebiester 13y ago
So, how do you write your unit tests? Within grails and guard (and other systems as well), I save my file and I have all the relevant unit tests running immediately. I have less than a second lapse.
At least, when I was working within play, it was painful enough to discourage me from test driving my code, especially if implicits were involved.
- saryant 13y agosbt ~test will run all your tests on file save. sbt ~test-quick will only run previously failed or new tests on file save. On one Play project we have ~160 test cases, including integration tests that spin up real Neo4j and Elasticsearch instances. Running the whole suite takes around 90 seconds. That would be far less if I did a better job separating unit and integration tests or mocking out the external dependencies.
- Aqueous 13y agoI spend most of my time running specs2 - unit specs - from the command line. I'm sure I could have sbt trigger on save but since I save pretty much constantly I'd have the tests running all the time. I will freely admit the compile time on tests is a bit extreme but I've found that it doesn't appreciably slow me down, since I typically run the tests when I'm confident the new code will pass. As for integration tests those run via Specs2/Selenium as well but I rarely run them from my own machine as they are continuously running on Travis CI whenever I push to our repositories.
- kasey_junk 13y agoNot sure about the state of the play framework, but the standard Scala build tool allows you to do the exact same thing as grails & guard using the ~test-quick operation.