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
Why State is the Most Important Part of Your Angular Application
fabiangosebrink
0
64
Angular testing made easy with Jest and Cypress
fabiangosebrink
0
98
Introducing state management into an application with NgRx
fabiangosebrink
0
150
Scalable architectures in Angular with Nx
fabiangosebrink
0
130
My Biggest Angular Mistakes and How To Avoid Them
fabiangosebrink
0
240
[iJS Munich] Better Angular Architectures with Libraries and Nx
fabiangosebrink
0
150
Mastering State Management in Angular with the NgRx Signal Store
fabiangosebrink
0
360
Angular Architectures with NgRx Stores & Effects
fabiangosebrink
0
110
Angular Testing made easy with Jest and Cypress
fabiangosebrink
0
110
Other Decks in Technology
See All in Technology
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
8.8k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
43k
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.8k
Introdução a Service Mesh usando o Istio
aeciopires
0
190
これがLambdaレス時代のChatOpsだ!実例で学ぶAmazon Q Developerカスタムアクション活用法
iwamot
PRO
8
1.1k
衛星画像超解像化によって実現する2D, 3D空間情報の即時生成と“AI as a Service”/ Real-time generation spatial data enabled_by satellite image super-resolution
lehupa
0
170
生成AI時代のセキュアコーディングとDevSecOps
yuriemori
0
120
なぜAWSを活かしきれないのか?技術と組織への処方箋
nrinetcom
PRO
5
960
Liquid AI Hackathon Tokyo プレゼン資料
aratako
0
110
プロポーザルのコツ ~ Kaigi on Rails 2025 初参加で3名の登壇を実現 ~
naro143
1
250
防災デジタル分野での官民共創の取り組み (2)DIT/CCとD-CERTについて
ditccsugii
0
310
Digitization部 紹介資料
sansan33
PRO
1
5.6k
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
460
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
115
20k
A Tale of Four Properties
chriscoyier
161
23k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Facilitating Awesome Meetings
lara
56
6.6k
Typedesign – Prime Four
hannesfritz
42
2.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
35
6.1k
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