Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
TDD With Ember.js
Kerrick Long
March 06, 2014
Programming
0
680
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
720
The ECMAScript formerly known as 6
kerrick
0
730
CSS Study Group 1
kerrick
0
710
CSS Study Group 2
kerrick
1
670
Services & Component Collaboration
kerrick
0
530
Donate STL #Build4STL Hackathon Keynote
kerrick
0
160
Donate STL
kerrick
0
590
JavaScript Promises - Thinking Sync in an Async World
kerrick
20
6.4k
Other Decks in Programming
See All in Programming
코드 품질 1% 올리기
pluu
1
1k
UI State Modeling 어떤게 좋을까?
laco2951
1
250
mrubyを1300円のボードで動かそう
yuuu
0
190
Kotlin 最新動向2022 #tfcon #techfeed
ntaro
1
1.2k
近況PHP / PHP in now a days
uzulla
4
2k
モデリングの費用対効果
masuda220
PRO
4
1k
機能横断型チームにおける技術改善
takeshiakutsu
3
510
TechFeed Conference 2022 - Kotlin Experimental
jmatsu
0
870
モバイルファーストデザインの爆速実装を考える
tanabee8
0
180
Hapticをカスタマイズしてみよう / ZOZO Tech Talk #6 Customize Haptic
endoumari
0
370
Loom is Blooming
josepaumard
3
570
SRE bridge the gap: Feature development to Core API / 機能開発チームとコアAPIチームの架け橋としてのSRE
kenzan100
1
640
Featured
See All Featured
A Tale of Four Properties
chriscoyier
149
20k
From Idea to $5000 a Month in 5 Months
shpigford
372
44k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
100
5.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
349
27k
Practical Orchestrator
shlominoach
178
8.6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
12
900
Designing for humans not robots
tammielis
241
23k
Reflections from 52 weeks, 52 projects
jeffersonlam
337
17k
Web Components: a chance to create the future
zenorocha
303
40k
Designing for Performance
lara
596
63k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
4
450
The World Runs on Bad Software
bkeepers
PRO
56
5.2k
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