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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
1
760
新メンバーのために、シニアエンジニアが環境を作る時代
puku0x
0
1.6k
Agent Skills 入門
puku0x
0
2k
ファインディにおけるフロントエンド技術選定の歴史
puku0x
2
2.2k
生成AIではじめるテスト駆動開発
puku0x
0
1.5k
実践!カスタムインストラクション&スラッシュコマンド
puku0x
2
3.4k
Nx × AI によるモノレポ活用 〜コードジェネレーター編〜
puku0x
0
1.7k
ファインディにおけるフロントエンド技術選定の歴史
puku0x
2
320
ファインディでのGitHub Actions活用事例
puku0x
9
4k
Other Decks in Technology
See All in Technology
2026-08-15 JAWS-UG 茨城 #16 Secrets ManagerにおけるSecret値の管理(Terraformの場合) / Secrets Manager Secrets
masasuzu
0
290
QAエンジニア起点で進める、SmartHRにおける信頼性向上について
kaomi_wombat
1
150
現場回帰したデータエンジニアが考える AI 時代のキャリア開発 / Career Development in the Age of AI Perspectives from a Hands-on Data Engineer
medley
0
120
【CEDEC2026】Creative Approaches to Localizing the Dialects and Unique Speech of Umamusume: Pretty Derby Characters in English
cygames
PRO
3
25k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
19k
FPGAが実現する遠方宇宙の高空間分解能天体撮影 -大型地上望遠鏡の視力を補正する「補償光学」とは?-
komei_mt
0
500
ガバメント AI 源内を地方自治体は活用できるのか可能性と課題、期待について
takeda_h
2
450
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
5k
도구에서 동료까지: 10년차 AI 스타트업의 AI 적응기
inureyes
PRO
0
210
Model Studio CLI × Token Plan
maigo999
0
190
少人数チームで実現する、大規模AWSサーバーレス基盤における"揺らがない"信頼性運用
maimyyym
1
110
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.4k
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
Technical Leadership for Architectural Decision Making
baasie
3
500
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
The Cult of Friendly URLs
andyhume
79
7k
Ethics towards AI in product and experience design
skipperchong
2
350
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
480
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Agile that works and the tools we love
rasmusluckow
331
22k
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