JavaScript BDD: Vows & Kyuri Vs. Jasmine [closed]
I was going to go with Vows and Kyuri, but then I found out about Jasmine. Which do you recommend? Vows or Jasmine? Is there a Cucumber implementation that works with Jasmine?
Jasmine
Pros :
- Well documented and supported
- Built-in spies
- RSPec-ish DSL
- Nice integration with other tools
Cons :
- Pollutes global namespace
- Not built for NodeJS
Vows
Pros :
- Clean and meaningful syntax
- Created for NodeJS (ie. Asynchronous Testing)
- CoffeeScript (it is really beautiful with)
- Watcher out of the box
Cons :
- Documentation (eg. teardown functions)
- Batches & Contexts can be odd when beginning
- No built-in spies (SinonJS ftw)
I would prefer Vows for testing NodeJS applications and Jasmine for client side code. Once you get used to CoffeeScript, vows becomes really clean and powerful.
I think it's important to note that Kyuri doesn't really do the same thing as Cucumber. It's actually just the gherkin bit. You could implement the functionality on top, but it's not coming out of the box.
Personally, I'm using vows. It's a bit brain-bending, but it's relatively simple and has a syntax which works better with CoffeeScript, which I'm very fond of. Also, I don't really want to involve Ruby in my build process, although your mileage may vary and I reserve the right to change my mind about that one.
I think jasmine is more suitable for unit testing in javascript. Is really simple and powerful, quite straightforward to get it and integrates nice with other tools such as rake or rails.
精彩评论