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.2k
CSS Study Group 2
kerrick
1
1.1k
Services & Component Collaboration
kerrick
0
760
Donate STL #Build4STL Hackathon Keynote
kerrick
0
350
Donate STL
kerrick
0
810
JavaScript Promises - Thinking Sync in an Async World
kerrick
20
7.8k
Other Decks in Programming
See All in Programming
Signal-Based Data FetchingWith the New httpResource
manfredsteyer
PRO
0
160
PHP で学ぶ OAuth 入門
azuki
1
130
マルチアカウント環境での、そこまでがんばらない RI/SP 運用設計
wa6sn
0
710
自分のために作ったアプリが、グローバルに使われるまで / Indie App Development Lunch LT
pixyzehn
1
150
AHC 044 混合整数計画ソルバー解法
kiri8128
0
330
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
24
6.1k
新しいPHP拡張モジュールインストール方法「PHP Installer for Extensions (PIE)」を使ってみよう!
cocoeyes02
0
340
Develop Faster With FrankenPHP
dunglas
2
3.2k
Vibe Codingをせずに Clineを使っている
watany
17
6.1k
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
200
国漢文混用体からHolloまで
minhee
1
170
State of Namespace
tagomoris
4
760
Featured
See All Featured
Scaling GitHub
holman
459
140k
Side Projects
sachag
452
42k
We Have a Design System, Now What?
morganepeng
52
7.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
650
Typedesign – Prime Four
hannesfritz
41
2.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
390
Bash Introduction
62gerente
611
210k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
9
740
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
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