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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kerrick Long
March 06, 2014
Programming
0
1.3k
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.2k
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
800
Donate STL #Build4STL Hackathon Keynote
kerrick
0
390
Donate STL
kerrick
0
820
JavaScript Promises - Thinking Sync in an Async World
kerrick
20
8.3k
Other Decks in Programming
See All in Programming
CSC307 Lecture 08
javiergs
PRO
0
670
CSC307 Lecture 03
javiergs
PRO
1
490
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
AI時代の認知負荷との向き合い方
optfit
0
160
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
230
CSC307 Lecture 02
javiergs
PRO
1
780
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
CSC307 Lecture 07
javiergs
PRO
0
550
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
並行開発のためのコードレビュー
miyukiw
0
150
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
110
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
BBQ
matthewcrist
89
10k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
260
How to Talk to Developers About Accessibility
jct
2
130
WCS-LA-2024
lcolladotor
0
450
How to Ace a Technical Interview
jacobian
281
24k
AI: The stuff that nobody shows you
jnunemaker
PRO
2
260
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.6k
The Curse of the Amulet
leimatthew05
1
8.5k
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