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
360
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
AI Coding Agent Enablement in TypeScript
yukukotani
17
7.2k
イベントソーシングとAIの親和性ー物語とLLMに理解できるデータ
tomohisa
1
160
OpenNext + Hono on Cloudflare でイマドキWeb開発スタックを実現する
rokuosan
0
110
tsconfigのオプションで変わる型世界
keisukeikeda
1
130
當開發遇上包裝:AI 如何讓產品從想法變成商品
clonn
0
2.6k
型安全なDrag and Dropの設計を考える
yudppp
5
660
DevTalks 25 - Create your own AI-infused Java apps with ease
kdubois
2
120
マテリアルって何者?RealityKitで扱うマテリアル入門
nao_randd
0
140
JVM の仕組みを理解して PHP で実装してみよう
m3m0r7
PRO
1
250
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
0
210
Doma で目指す ORM 最適解
nakamura_to
1
160
がんばりすぎないコーディングルール運用術
tsukakei
1
180
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
Side Projects
sachag
454
42k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
Thoughts on Productivity
jonyablonski
69
4.7k
Site-Speed That Sticks
csswizardry
7
590
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
620
Building a Modern Day E-commerce SEO Strategy
aleyda
40
7.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
750
The World Runs on Bad Software
bkeepers
PRO
68
11k
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