Spock is a powerful Groovy-based framework that makes testing applications written in Java (as well as Groovy, Kotlin etc.) a very pleasant experience. Because it’s built on top of good ol’ JUnit, it integrates well with most of the existing test/build tooling. However, making it play nicely with the testing infrastructure of Spring framework (especially Spring Boot) used to be a bit tricky. Luckily, the latest Spock version 1.1 comes with a few improvements that make testing Spring apps (including mocking) easier.
I had a some time this weekend and was exploring the ways we could improve our javascript unit tests. The one thing I do not really like about angular unit testing is too much boilerplate code. Probably you all know something like this:
|
|
It’s not very exciting. Sure, you could create some level of abstraction above it and reuse it in all your tests, but it’s not so trivial and probably need significant amount of time to implement.
And here is a little utility library ng-describe to help.