-
Notifications
You must be signed in to change notification settings - Fork 12
TDD By Example
coloradokim edited this page Oct 3, 2017
·
7 revisions
2015 Ember Conf Talk by Torin Billups
- The purpose of TDD is to get feedback
- Create (or generate) an acceptance test
- Start with a high-level test (i.e.
/
) that mimics where the user might find themselves first - The first test will be to find a group of items
- Assert that a certain number of items will be returned
- Build a route that will return the items
- In the routes, return an array that is the same length as defined in your test.
- Once you get a passing test, add a new assert statement where you return sample data that you've hard-coded
- Use the red to get feedback, even if your tests don't go right from red to green.
- If your red messages are different, it helps you figure out if you're on the right track
- Client-side acceptance tests are all about the behavior of the app and your user, not the structure of your code