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
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
1k
The ECMAScript formerly known as 6
kerrick
0
1.1k
CSS Study Group 1
kerrick
0
1.1k
CSS Study Group 2
kerrick
1
980
Services & Component Collaboration
kerrick
0
730
Donate STL #Build4STL Hackathon Keynote
kerrick
0
280
Donate STL
kerrick
0
800
JavaScript Promises - Thinking Sync in an Async World
kerrick
20
7.3k
Other Decks in Programming
See All in Programming
2 週間で Twitter Bot を作ってみた
contour_gara
0
570
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
950
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
190
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
2
200
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
150
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
970
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
340
Fragment Composition of GraphQL
quramy
7
1k
ゆるい個人開発のススメ
kuroppe1819
10
990
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
340
Fast JSX: Don't clone props object #28768
yossydev
1
130
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
25
5.8k
Building Effective Engineering Teams - LeadDev
addyosmani
28
1.8k
Done Done
chrislema
178
15k
Statistics for Hackers
jakevdp
789
220k
Building a Scalable Design System with Sketch
lauravandoore
456
32k
What's new in Ruby 2.0
geeforr
337
31k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
How to name files
jennybc
65
93k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Become a Pro
speakerdeck
PRO
11
4.5k
4 Signs Your Business is Dying
shpigford
175
21k
The Art of Programming - Codeland 2020
erikaheidi
42
12k
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