headless You want to choose a test runner that supports running your tests in the browser, so you'll have access to devtools for debugging. The runner should also work headlessly, so you can test in the background as you code and be able to integrate with a CI server. The runner will need to access your compiled assets, so integration with your build environment is important.
headless • Client-side test framework • TDD vs. BDD interfaces and assertions Popular javascript test frameworks include QUnit, Mocha, Jasmine. QUnit is used to test Ember itself, and is the most popular choice on the core team because of its speed and solid async support. Mocha is very accessible and offers custom TDD and BDD interfaces. It works with the flexible Chai assertion library. Jasmine has been extremely popular for the past few years, but seems to be slipping recently. It has awkward async support and has not seen much activity lately. It is unique in that it runs tests in parallel, while Mocha and QUnit run them serially. I've found that this can lead to non-deterministic test results with bugs that are tricky to isolate. The framework in which you write your tests will probably be the most time consuming to refactor, since every one of your tests will be written for that framework. Therefore, take some time to choose carefully.
headless • Client-side test framework • TDD vs. BDD interfaces and assertions • Integration testing approach • Full stack vs. client-side only vs. both Full stack end-to-end tests tend to be slow to run, brittle, and redundant with testing done on both the client and server side. I'd recommend testing "happy paths" through your app rather than trying for complete coverage with E2E tests. The new ember-testing package shows promise for client-side integration tests.
Client-side test framework: • Mocha / Chai • Integration tests: • Capybara and/or ember-testing Konacha can run tests in the browser or headlessly with Phantomjs or Selenium drivers. Konacha runs every test in an iframe for complete separation. This is the stack Jo Liss talked about in her EmberCamp talk Konacha is opinionated: it's only compatible with Mocha Full stack end-to-end tests of your Rails application can be written in Ruby with Capybara. Capybara can run with either the selenium or phantomjs drivers. You can set breakpoints in your Capybara tests and debug in either Ruby or Firefox if needed. This is a slow process.
Client-side test framework: • QUnit or Mocha or Jasmine • Integration tests: • Casper.js and/or ember-testing Karma can run tests in the browser or headlessly with Phantomjs or Selenium drivers. It can even target multiple browsers and/or headless drivers at once!
Client-side test framework: • QUnit or Mocha or Jasmine • Integration tests: • Capybara and/or ember-testing Like Konacha, Teabag can run tests in the browser or headlessly with Phantomjs or Selenium drivers Teabag is a relatively new test runner for Rails that appears to be flexible and promising. Caveat: I haven't tried it myself yet!
we // want to have complete control of runloops. Ember.testing = true; // Defer App readiness (it will be advanced in each test) App.deferReadiness(); // Prevent the router from manipulating the browser's URL. App.Router.reopen({location: 'none'});
data directly into the store • Load data through an adapter • Use Sinon to mock data for your adapter • Request data from the server (for an end-to-end test)