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
Angular Testing von A bis Z
Search
Fabian Gosebrink
October 11, 2017
Technology
240
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Angular Testing von A bis Z
AngularDays 2017 in Berlin - Testing from A to Z
Fabian Gosebrink
October 11, 2017
More Decks by Fabian Gosebrink
See All by Fabian Gosebrink
Advanced Signal Store: Structuring State for Real Angular Applications
fabiangosebrink
0
96
NgRx Signal Store - A Deeper Dive
fabiangosebrink
0
66
Modern Angular Apps in 2026
fabiangosebrink
0
120
Why State is the Most Important Part of Your Angular Application
fabiangosebrink
0
150
Angular testing made easy with Jest and Cypress
fabiangosebrink
0
180
Introducing state management into an application with NgRx
fabiangosebrink
0
270
Scalable architectures in Angular with Nx
fabiangosebrink
0
240
My Biggest Angular Mistakes and How To Avoid Them
fabiangosebrink
0
350
[iJS Munich] Better Angular Architectures with Libraries and Nx
fabiangosebrink
0
230
Other Decks in Technology
See All in Technology
Head First モブプログラミング / Head First Mobprogramming
takaking22
10
12k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
19k
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
Genie Codeハンズオン応用編
taka_aki
0
100
My broken English still works: speaking at global OSS events
naruoga
0
100
事業価値と Engineering 2026年度版
recruitengineers
PRO
50
24k
20260807_第6回_関東kaggler会LT_claw系bot xangiと始める、"寂しくない" kaggle
sugupoko
0
290
認知負荷をGemini で溶かす — GKE 基盤「Orbit」における AI エージェントの実践
sansantech
PRO
1
300
会社紹介資料 / Sansan Company Profile
sansan33
PRO
24
430k
AIコーディングの次。コードレビューと理解負荷を解消して組織の開発生産性を高める
moongift
PRO
2
2.6k
モバイルアプリ開発概論2026
recruitengineers
PRO
6
610
【CEDEC2026】『Relink』を拡張せよ - 『GRANBLUE FANTASY: Relink - Endless Ragnarok』の開発速度と品質を守るCI運用
cygames
PRO
0
180
Featured
See All Featured
How GitHub (no longer) Works
holman
316
150k
Six Lessons from altMBA
skipperchong
29
4.4k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
470
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Paper Plane (Part 1)
katiecoart
PRO
1
10k
Writing Fast Ruby
sferik
630
63k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
430
Designing for Performance
lara
611
70k
Amusing Abliteration
ianozsvald
1
250
Transcript
A -Z Testing
Fabian Gosebrink
None
None
Agenda Exploring the Tools Unit Testing with Angular Integration Testing
with Angular End 2 End Testing with Angular Test Driven Development
Testing
UnitTesting
ShallowTesting
INtegrationTesting
End 2 End Testing
Strategies
SmallesT as Possible
REadable
Do Not Mock...
...That Often
Test Driven
Explore the tools
Explore the tools Protractor Jasmine Karma
Jasmine • Behaviour Driven Development • Fast
None
None
None
Some Jasmine Matchers expect(array).toContain(member); expect(mixed).toBeDefined(); expect(mixed).toBeFalsy(); expect(mixed).toBeNull(); expect(mixed).toBeTruthy(); expect(mixed).toBeUndefined(); expect(mixed).toEqual(mixed);
expect(mixed).toMatch(pattern); expect(number).toBeCloseTo(number, decimalPlaces); expect(number).toBeGreaterThan(number); expect(number).toBeLessThan(number); expect(number).toBeNaN(); expect(spy).toHaveBeenCalled(); expect(spy).toHaveBeenCalledTimes(number); expect(spy).toHaveBeenCalledWith(...arguments);
None
None
Skip Tests
Karma • Test runner • Spawns browser & runs tests
• Also on CommandLine
None
None
Protractor • End-to-end test framework • Runs in a real
browser • Test like a user
Testing
Component.ts
Component.spec.ts
AngularCLI
None
None
None
ARRANGE ACT ASSERT
None
Testing Pipes
None
Testing Services
None
None
None
Testing Services ASYNC
None
None
None
Code...
Testing Routing
None
None
Testing Components
Code...
None
https://github.com/FabianGosebrink/AngularDays-2017 https://offering.solutions https://swissangular.com @FabianGosebrink
Links https://medium.com/google-developer-experts/angular-2-testing-guide-a485b6cb1ef0 https://blog.thoughtram.io/angular/2016/12/27/angular-2-advance-testing-with-custom- matchers.html https://blog.nrwl.io/essential-angular-testing-192315f8be9b https://vsavkin.com/three-ways-to-test-angular-2-components-dcea8e90bd8d https://medium.com/letsboot/angular-end-to-end-testing-c3b9950fdd41 https://developers.livechatinc.com/blog/testing-angular-2-apps-routeroutlet-and-http/ https://jasmine.github.io/edge/introduction.html#section-Included_Matchers