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.7k
ファインディにおけるフロントエンド技術選定の歴史
puku0x
2
310
ファインディでのGitHub Actions活用事例
puku0x
9
3.9k
Findyの開発生産性向上への取り組み ~Findyフロントエンドの場合~
puku0x
0
490
Other Decks in Technology
See All in Technology
Making sense of Google’s agentic dev tools
glaforge
1
280
AI Coding Agent時代のcdk-nagガードレール 〜組織ルールを強制CIで守り抜く設計の挑戦〜
mhrtech
3
390
ボーイスカウトルールでメモリやスキルを改善しよう
azukiazusa1
4
1.4k
アップデートで何が変わった?デモで学んで使いこなすIBM Bob2.0
muehara
0
110
見守りエージェントを作ってみた(ローカルLLM + Hermes Agent)
happysamurai294
0
110
Claude Code公式skillで 自分の仕事を少しずつ手放そう!(Claude Code開発ノウハウ大公開スペシャル by クラスメソッド)
kaym
1
480
型は壁、Rustでもバグを直すな、表現できなくせよ
nwiizo
14
2.1k
美しいコードを書くためにF#を学んでみた話
yud0uhu
1
460
End-to-Endで考える信頼性 —LINEアプリにおけるクライアント開発×SRE連携の実践
maruloop
4
4.5k
AIと共生する開発者プラットフォーム:バクラクのモノレポ×マイクロサービス基盤
sakajunquality
2
3.7k
【Claude Code】鹿野さんに聞く 私の推しの並行開発環境 大公開 / claude-code-parallel-2026-07-15
tonkotsuboy_com
12
8.6k
個人開発で育てる「大規模設計の苗床」 - AI時代の1人開発から始める業務への知識接続 / The Seedbed for Large-Scale Design - From AI-Era Solo Projects to Professional Knowledge
bitkey
PRO
1
280
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
220
The Cost Of JavaScript in 2023
addyosmani
55
10k
Site-Speed That Sticks
csswizardry
13
1.3k
Rails Girls Zürich Keynote
gr2m
96
14k
Everyday Curiosity
cassininazir
0
260
The Pragmatic Product Professional
lauravandoore
37
7.4k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
220
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.8k
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