Upgrade to Pro — share decks privately, control downloads, hide ads and more …

An ADD approach to testing ember.js

An ADD approach to testing ember.js

Slides from November 2012 ember nyc meetup

Video of the presentation is here: http://bit.ly/WlvOhD

Michael Grassotti

November 29, 2012
Tweet

More Decks by Michael Grassotti

Other Decks in Technology

Transcript

  1. Acceptance Driven Development Focus on acceptance criteria, don’t write code

    you don’t need. Start with acceptance tests. Verify that your app works for happy-path use cases 3
  2. Konacha Konacha is a mocha/chai test runner for rails 3

    apps. Each spec is executed in an iframe runs in-browser or command-line 9
  3. How? Boot instance of app Load test data Use App.router.route(‘/’)

    to navigate Maybe submit a form or two Verify output, like $(‘#id’).text() 20
  4. App.reset() ? Would be nice, not gonna happen anytime soon.

    Roll your own involves: reset state of controllers rollback injections clear dom god-knows what else. Hard since Ember is a moving target... So without reset(), how do we prevents specs from having side effects? Run each integration test in isolated environment (iframe) via konacha test runner 23