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
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TDD With Ember.js
Kerrick Long
March 06, 2014
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.4k
CSS Study Group 1
kerrick
0
1.4k
CSS Study Group 2
kerrick
1
1.1k
Services & Component Collaboration
kerrick
0
820
Donate STL #Build4STL Hackathon Keynote
kerrick
0
420
Donate STL
kerrick
0
840
JavaScript Promises - Thinking Sync in an Async World
kerrick
20
8.4k
Other Decks in Programming
See All in Programming
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
140
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
140
act1-costs.pdf
sumedhbala
0
240
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
120
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
120
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
4.8k
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
310
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
500
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.1k
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
170
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
580
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
490
The Cost Of JavaScript in 2023
addyosmani
55
10k
Believing is Seeing
oripsolob
1
170
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
210
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Thoughts on Productivity
jonyablonski
76
5.3k
Typedesign – Prime Four
hannesfritz
42
3.1k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Utilizing Notion as your number one productivity tool
mfonobong
4
440
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