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
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
[iJS Munich] Better Angular Architectures with Libraries and Nx
fabiangosebrink
0
53
Mastering State Management in Angular with the NgRx Signal Store
fabiangosebrink
0
92
Angular Architectures with NgRx Stores & Effects
fabiangosebrink
0
42
Angular Testing made easy with Jest and Cypress
fabiangosebrink
0
50
Introducing NgRx in an Nx Angular Workspace
fabiangosebrink
0
240
Full-Stack-Web-Applications with Angular, Nx and .NET
fabiangosebrink
0
130
Angular Signals - Revolution in Angular development
fabiangosebrink
0
150
Kickstarting Your Journey with NgRx Signal Store
fabiangosebrink
0
100
Angular Signals under the Hood
fabiangosebrink
0
390
Other Decks in Technology
See All in Technology
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
飲食店データの分析事例とそれを支えるデータ基盤
kimujun
0
160
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
130
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
180
Terraform Stacks入門 #HashiTalks
msato
0
360
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.2k
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
150
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
200
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
6
660
DynamoDB でスロットリングが発生したとき/when_throttling_occurs_in_dynamodb_short
emiki
0
250
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
We Have a Design System, Now What?
morganepeng
50
7.2k
Thoughts on Productivity
jonyablonski
67
4.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Fireside Chat
paigeccino
34
3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
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