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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Fabian Gosebrink
October 11, 2017
Technology
0
230
Angular Testing von A bis Z
AngularDays 2017 in Berlin - Testing from A to Z
Fabian Gosebrink
October 11, 2017
Tweet
Share
More Decks by Fabian Gosebrink
See All by Fabian Gosebrink
Modern Angular Apps in 2026
fabiangosebrink
0
21
Why State is the Most Important Part of Your Angular Application
fabiangosebrink
0
82
Angular testing made easy with Jest and Cypress
fabiangosebrink
0
130
Introducing state management into an application with NgRx
fabiangosebrink
0
200
Scalable architectures in Angular with Nx
fabiangosebrink
0
160
My Biggest Angular Mistakes and How To Avoid Them
fabiangosebrink
0
270
[iJS Munich] Better Angular Architectures with Libraries and Nx
fabiangosebrink
0
160
Mastering State Management in Angular with the NgRx Signal Store
fabiangosebrink
0
410
Angular Architectures with NgRx Stores & Effects
fabiangosebrink
0
120
Other Decks in Technology
See All in Technology
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
350
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
150
Cosmos World Foundation Model Platform for Physical AI
takmin
0
900
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.4k
今日から始めるAmazon Bedrock AgentCore
har1101
4
410
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
210
Webhook best practices for rock solid and resilient deployments
glaforge
1
290
Frontier Agents (Kiro autonomous agent / AWS Security Agent / AWS DevOps Agent) の紹介
msysh
3
170
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.9k
AI駆動PjMの理想像 と現在地 -実践例を添えて-
masahiro_okamura
1
120
AIエージェントを開発しよう!-AgentCore活用の勘所-
yukiogawa
0
170
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
4.9k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
340
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
55
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
4 Signs Your Business is Dying
shpigford
187
22k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
720
Typedesign – Prime Four
hannesfritz
42
2.9k
Chasing Engaging Ingredients in Design
codingconduct
0
110
The Art of Programming - Codeland 2020
erikaheidi
57
14k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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