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
FrontEnd Test Night - Fukuoka #1
Search
puku0x
March 05, 2019
Technology
450
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
0
1.5k
Agent Skills 入門
puku0x
0
1.9k
ファインディにおけるフロントエンド技術選定の歴史
puku0x
2
2.1k
生成AIではじめるテスト駆動開発
puku0x
0
1.4k
実践!カスタムインストラクション&スラッシュコマンド
puku0x
2
3.3k
Nx × AI によるモノレポ活用 〜コードジェネレーター編〜
puku0x
0
1.6k
ファインディにおけるフロントエンド技術選定の歴史
puku0x
2
300
ファインディでのGitHub Actions活用事例
puku0x
9
3.9k
Findyの開発生産性向上への取り組み ~Findyフロントエンドの場合~
puku0x
0
480
Other Decks in Technology
See All in Technology
AIっぽい文章を採点して人間らしく直すアプリを作ってみた
yama3133
2
130
チームで進めるAI駆動アジャイル×ウォーターフォール
kumaiu
0
150
NAB Show 2026 動画技術関連レポート / NAB Show 2026 Report
cyberagentdevelopers
PRO
0
170
社内 AI エージェント Synapse と セマンティックレイヤーの育て方
hiroakis
2
1.7k
ACE-Step-1.5で見る 音楽生成AIのしくみと“破綻だけ直す”Retake機能の開発【zennfes spring 2026 登壇資料】
personabb
1
140
FinOps × AIエージェントで実現する コストインシデントの自動調査
oasis1994liveforever
0
130
タクシーアプリ『GO』の実践的データ活用
mot_techtalk
3
190
Chainlitで作るお手軽チャットUI
ynt0485
0
210
AIソロプレナー時代に2ヶ月で20人増員した事業創造会社の開発組織の話
miyatakoji
0
610
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
230
2026.06.13_AI時代に事業会社が「SIer出身エンジニア」を求める理由 / Why Businesses Seek Engineers with a System Integrator Background in the AI Era
jumtech
0
1.1k
Disciplined Vibes: Scaling AI-Assisted Engineering
sheharyar
0
140
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
390
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
470
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
Utilizing Notion as your number one productivity tool
mfonobong
4
320
Accessibility Awareness
sabderemane
1
140
Navigating Team Friction
lara
192
16k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
540
Faster Mobile Websites
deanohume
310
31k
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