Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TDD With Ember.js
Search
Kerrick Long
March 06, 2014
Programming
0
1.1k
TDD With Ember.js
Kerrick Long
March 06, 2014
Tweet
Share
More Decks by Kerrick Long
See All by Kerrick Long
15 Things You Shouldn't Do In Ember Anymore
kerrick
0
1.1k
The ECMAScript formerly known as 6
kerrick
0
1.3k
CSS Study Group 1
kerrick
0
1.3k
CSS Study Group 2
kerrick
1
1.1k
Services & Component Collaboration
kerrick
0
770
Donate STL #Build4STL Hackathon Keynote
kerrick
0
370
Donate STL
kerrick
0
810
JavaScript Promises - Thinking Sync in an Async World
kerrick
20
7.9k
Other Decks in Programming
See All in Programming
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
530
What's new in AppKit on macOS 26
1024jp
0
180
構造化・自動化・ガードレール - Vibe Coding実践記 -
tonegawa07
0
150
プロダクトという一杯を作る - プロダクトチームが味の責任を持つまでの煮込み奮闘記
hiliteeternal
0
280
構文解析器入門
ydah
7
1.9k
中級グラフィックス入門~効率的なメッシュレット描画~
projectasura
3
1.7k
Gemini CLIの"強み"を知る! Gemini CLIとClaude Codeを比較してみた!
kotahisafuru
2
190
知って得する@cloudflare_vite-pluginのあれこれ
chimame
1
120
AWS Summit Japan 2024と2025の比較/はじめてのKiro、今あなたは岐路に立つ
satoshi256kbyte
1
250
Googleの新しいコーディングAIエージェントJulesを使ってみた
tonionagauzzi
0
140
Gemini CLI のはじめ方
ttnyt8701
1
110
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
820
Featured
See All Featured
Building an army of robots
kneath
306
45k
Code Review Best Practice
trishagee
69
19k
Designing for Performance
lara
610
69k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.6k
How STYLIGHT went responsive
nonsquared
100
5.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
720
Being A Developer After 40
akosma
90
590k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
GraphQLとの向き合い方2022年版
quramy
49
14k
Transcript
Test Driven Development
Kerrick Long Things I make and do Where to find
me online twitter.com/KerrickLong github.com/Kerrick Lead Front-end Developer at Second Street KerrickLong.com www. meetup.com/STLEmber
Why TDD?
Outside-In
Integration Tests Unit Tests then
Red Green Refactor
Green Refactor
Test-Driven Design
How?
Integration Test
Integration Test
Integration Test Unit Test
Integration Test Unit Test
Integration Test Unit Test Unit Test Unit Test
Integration Test Unit Test Unit Test Unit Test
Integration Test Unit Test Unit Test Unit Test Unit Test
Integration Test Unit Test Unit Test Unit Test Unit Test
Integration Test Unit Test Unit Test Unit Test Unit Test
Integration Test Unit Test Unit Test Unit Test Unit Test
Integration Test Unit Test Unit Test Unit Test Unit Test
Tooling
Karma Test Runner
None
None
None
None
QUnit.js
Assertions
QUnit.assert.ok( makeBoolean() ) Assertions
QUnit.assert.equal( makeTen(), '10' ) Assertions
QUnit.assert.strictEqual( makeTen(), 10 ) Assertions
QUnit.assert.deepEqual( makeObject(), { foo: ‘bar’, baz: 10 } ) Assertions
QUnit.assert.propEqual( makeObject(), { foo: ‘bar’, baz: 10 } ) Assertions
QUnit.assert.throws( function() { throwError() }, ‘Example Thrown Error’ ) Assertions
Ember Test Helpers
App.rootElement = ‘#qunit-fixture’ App.setupForTesting() App.injectTestHelpers(QUnit)
QUnit.visit(‘/posts’)
QUnit.find(‘.add’, ‘.list’)
QUnit.fillIn( ‘.name’, ‘Kerrick’ )
QUnit.click(‘.submit’)
QUnit.keyEvent( ‘.wysiwyg’, ‘keypress’, 30 )
QUnit.visit(‘/posts/new’) .fillIn(‘.name’, ‘Hello’) .click(‘.submit’) .then(function() { QUnit.assert.ok(true) })
QUnit.visit(‘/posts/new’) QUnit.fillIn(‘.name’, ‘Hi’) QUnit.click(‘.submit’) QUnit.andThen(function() { QUnit.assert.ok(true) })
QUnit.visit(‘/posts/new’) QUnit.fillIn(‘.name’, ‘Hi’) QUnit.click(‘.submit’) QUnit.andThen(function() { QUnit.assert.ok(true) })
Integration Tests
Controller Unit Tests
Component Unit Tests
Mixin Unit Tests
Component Unit Tests