integration tests for your ember.js application
DESCRIPTION
Lately, there’s been a lot of attention going to testing in the Ember.js community but I feel it focuses almost exclusively on the Ember side of things. However, most applications interface with a back-end and I don’t think much has been written how to do integration tests in Ember.js that test your whole stack, including the back-end. Hence this talk. Particularly, I go into how you can seed your data before running each test. The presentation was given at the Boston Ember.js meetup on the 10th of July 2014. You can find the video here: https://www.youtube.com/watch?v=S4M78SO3gAc#t=3740TRANSCRIPT
From my experiences working on Hstry
Integration tests
Test the whole stack from the user's perspective
Were driven by back-end back in the "old" days
This is how the application was tested too...Hstry
... but the tests were slow, brittle and flaky.
Ember.js now provides a nice framework to dointegration tests...
visit
fillIn
click
find
currentRouteName
... plus your own
... and Hstry converted (almost) all its integrationtests successfully!
What to test?
What the user is supposed to see.
Click on button X, should see Y.
Go on page X, should see Y.
That the data is correctly persisted.
Click on this "Submit" button, issues POST request to endpoint XXX with parametersYYY.
What do you need?
Testing framework: QUnit (default for Ember), Mocha,Jasmine,...
Test runner: Teaspoon (Rails), Testem (Node.js)
DEMO
What about seed data?I want to test the /blog_posts/POST_ID route.
Need to set up data in back-end beforehand
How?An API endpoint /seed_db
Call this endpoint before each test
Do not open this endpoint in production!
DEMO
is hiringHstryLooking for an experienced Rails and Ember.js full-stack developer
Thank you