Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
FrontEnd Test Night - Fukuoka #1
Search
puku0x
March 05, 2019
Technology
460
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
FrontEnd Test Night - Fukuoka #1
puku0x
March 05, 2019
More Decks by puku0x
See All by puku0x
え?フロントエンドエンジニアの ワイがインフラも!?
puku0x
1
1.5k
新メンバーのために、シニアエンジニアが環境を作る時代
puku0x
0
1.6k
Agent Skills 入門
puku0x
0
2.2k
ファインディにおけるフロントエンド技術選定の歴史
puku0x
2
2.3k
生成AIではじめるテスト駆動開発
puku0x
0
1.5k
実践!カスタムインストラクション&スラッシュコマンド
puku0x
2
3.4k
Nx × AI によるモノレポ活用 〜コードジェネレーター編〜
puku0x
0
1.7k
ファインディにおけるフロントエンド技術選定の歴史
puku0x
2
330
ファインディでのGitHub Actions活用事例
puku0x
9
4k
Other Decks in Technology
See All in Technology
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
730
[2026-09-11]SREは誰のもの?運用エンジニアが始める 「SRE領域への越境」とチームの進化の軌跡 〜Road to NEXT CRE
tosite
0
290
HHKBエバンジェリストになる方法
941
0
110
Genieを崇めよ
kameitomohiro
0
150
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
200
映像変換サーバーなしで端末内でHLSを生成してライブ配信
hikarusato
0
120
データ_AIの事業の勝敗をわけるもの
nek0128
0
380
Reactの設計論
uhyo
24
13k
2026-09-18 gotanda.sre Terraformで複数環境作ったり、複数Stateに分割したりそれとTerragrunt / Terraform multi envs and multi states
masasuzu
1
410
「ピッケル本」日本語版は4.0(第6版)が出版されるべき / pickaxe4-nagoyark05
kakutani
1
150
10分で知る最近のOmarchy
komagata
0
350
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
5
630
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
990
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
Building Applications with DynamoDB
mza
96
7.2k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Odyssey Design
rkendrick25
PRO
2
810
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
410
We Are The Robots
honzajavorek
0
370
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Crafting Experiences
bethany
1
340
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
430
Navigating Weather and Climate Data
rabernat
0
520
Transcript
Angularがやれって言うから テスト書き始めました FrontEnd Test Night - Fukuoka #1
Noriyuki Shinpuku ng-fukuoka organizer @puku0x 2 VEGA corporation Co., Ltd.
3 AngularJS
Testing? 4
5 Angular
Angular A platform for building modern Web Apps • Move
faster • Scale better • Reach further https://angular.io/ 6
7 Angular CLI
Generating a component $ ng generate component sample CREATE src/app/sample/sample.component.scss
(0 bytes) CREATE src/app/sample/sample.component.html (23 bytes) CREATE src/app/sample/sample.component.spec.ts (614 bytes) CREATE src/app/sample/home.component.ts (262 bytes) UPDATE src/app/app.module.ts (467 bytes) 8
Generating a service $ ng generate service api CREATE src/app/api.service.spec.ts
(323 bytes) CREATE src/app/api.service.ts (133 bytes) 9
*.spec.ts? 10
11 Karma
12 Protractor
Creating an app $ ng new my-app --routing --style=scss CREATE
my-app/angular.json (3895 bytes) CREATE my-app/package.json (1389 bytes) CREATE my-app/src/karma.conf.js (1019 bytes) CREATE my-app/src/tsconfig.spec.json (256 bytes) CREATE my-app/e2e/protractor.conf.js (752 bytes) CREATE my-app/e2e/tsconfig.e2e.json (213 bytes) CREATE my-app/src/main.ts (372 bytes) ... 13
Unit Test 14
describe('SampleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [
SampleComponent ] }).compileComponents(); })); it('should create', () => { fixture = TestBed.createComponent(SampleComponent); component = fixture.componentInstance; expect(component).toBeTruthy(); }); }); 15
import { NO_ERRORS_SCHEMA } from '@angular/core'; describe('SomeComplexComponent', () => {
beforeEach(async(() => { TestBed.configureTestingModule({ ... schemas: [NO_ERRORS_SCHEMA] }).compileComponents(); })); }); 16
describe('ApiService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [
HttpClientTestingModule ] }); service = TestBed.get(ApiService); }); it('should be created', () => { expect(service).toBeTruthy(); }); }); 17
import { HttpTestingController } from '@angular/common/http/testing'; describe('UserService', () => {
beforeEach(() => { ... httpMock = TestBed.get(HttpTestingController); }); afterEach(() => httpMock.verify()); it('should successfully mock request', () => { const response = {...}; service.fetch().subscribe(result => expect(result).toBe(response)); const req = httpMock.expectOne(`/api/v1/samples`); expect(req.request.method).toEqual('GET'); req.flush(response); }); }); 18
E2E test 19
import { browser, by, element } from 'protractor'; describe('App', ()
=> { it('should display title', () => { browser.get('/'); const title = element(by.css('h1')).getText(); expect(title).toEqual('Hello Angular!'); }); }); 20
Snapshot test? 21
$ ng add @briebug/jest-schematic 22
describe('AppComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [AppComponent]
}).compileComponents(); })); test('should match to snapshot', () => { const fixture = TestBed.createComponent(AppComponent); expect(fixture).toMatchSnapshot(); }); }); 23
24 Nx(Nrwl Extensions for Angular)
25
26
• Integrated Unit Test • Integrated E2E Test • Extensible
CLI 27
28 https://angular.jp/ More details are in...
@puku0x Noriyuki Shinpuku ng-fukuoka organizer Thank you! 29