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
Ionic(Angular)初心者のテスト奮闘記
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
kkeeth
August 05, 2017
Programming
0
1.4k
Ionic(Angular)初心者のテスト奮闘記
テストの必要性、IonicとAngularのテスト環境の比較、Nativeのテストなどを話します。
kkeeth
August 05, 2017
Tweet
Share
More Decks by kkeeth
See All by kkeeth
Programming to play with p5.js
clown0082
0
63
とある EM の初めての育休からの学び
clown0082
1
5k
The history of Javascript frameworks: changes in front-end design philosophy
clown0082
2
210
Visually experience the beauty of mathematics with p5.js
clown0082
1
3.2k
Rediscover the joy of coding with Creative Coding
clown0082
0
1.8k
全員が意思決定する会社で開発者体験や生産性を見る大変さについて
clown0082
0
650
JavaScript × Mathematics go to Digital Art
clown0082
1
430
In-house study group at YUMEMI
clown0082
0
230
Playing Ionic Logo by p5.js
clown0082
0
320
Other Decks in Programming
See All in Programming
2026年 エンジニアリング自己学習法
yumechi
0
130
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
12
6.5k
AgentCoreとHuman in the Loop
har1101
5
220
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
AtCoder Conference 2025
shindannin
0
1k
CSC307 Lecture 05
javiergs
PRO
0
490
Oxlint JS plugins
kazupon
1
530
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
21k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
Embracing the Ebb and Flow
colly
88
5k
Visualization
eitanlees
150
17k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Darren the Foodie - Storyboard
khoart
PRO
2
2.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
HDC tutorial
michielstock
1
350
Transcript
IonicʢAngularʣॳ৺ऀ ͷςετฃಆه by @kuwahara_ngv4 2017/08/06 ʲHTML5ͰΞϓϦΛ࡞ΔʳIonic 2+ ϛʔτΞοϓ౦ژ
ࣗݾհ
Basic information ɹlet my_info = { ɹɹɹtwitter: ‘@kuwahara_ngv4’, ɹɹɹGitHub: ’k-kuwahara’,
ɹɹɹQiita: ’clown0082’, ɹɹɹWorkplace: ‘Ϩϓϥϗʔϯגࣜձࣾ’ ɹ}
Skill Sets • PHP • JavaScript • Ruby
Agenda • ςετͷඞཁੑ • Ionic Appͷςετ 1. Angularͷςετڥ 2. Ionic
TeamͷϢχοτςεταϯϓϧ 3. Nativeػೳͷςετ • ·ͱΊ
Topics not told today • E2Eςετʹ͍ͭͯ • Ionicʹ͓͚ΔςετͷTips • AoTʹ͍ͭͯ
ςετͷඞཁੑ
γεςϜΞϓϦέʔγϣϯ ͚ͩͰͳ͘
ࣗಈൢചػ CLI ΞϓϦέʔγϣϯ ՈͷυΞ Զઐ༻twitter ΫϥΠΞϯτ
ඞͣςετʢಈ࡞ݕূʣ ͞Ε͍ͯΔ
ҿΈങ͑Δʁ ίϚϯυ࣮ߦͰ͖Δʁ ։͘ or ด͡Δʁ πΠʔτͰ͖Δʁ λΠϜϥΠϯදࣔ͞ΕΔʁ
ҿΈങ͑Δʁ ίϚϯυ࣮ߦͰ͖Δʁ ։͘ or ด͡Δʁ πΠʔτͰ͖Δʁ λΠϜϥΠϯදࣔ͞ΕΔʁ ಈ࡞͠ͳ͚ΕΘΕͳ͍
ͲΜͳϓϩμΫτͰ ςετʢಈ࡞ݕূʣඞཁ
Q.Ͱʮςετίʔυʯ ඞཁͳͷ͔ʁ ※Ҏ߱ɺςετίʔυ => ςετ
A. ઈରʹඞཁͱݶΒͳ͍ ͨͩɺ༨༟͕͋ΔͳΒ ॻ͍ͨ΄͏͕ྑ͍
Necessity of test code • ਓ͕Βͳͯ͘ྑ͍ςετΛࣗಈԽͰ͖Δ • ༷ͷ֬ೝ࿙ΕɺόάΛݟ͚ͭΔ͜ͱ͕͋Δ • ίʔυͷ࣭ΛߴΊΔ͜ͱʹܨ͕Δ
Ionic Appͷςετ
$ ionic start hoge (tabs)
package.jsonͷҰ෦ൈਮ
ςετ༻ͷͷ͕Կ Πϯετʔϧ͞Εͳ͍ʜͩͱʁ
ͭ·ΓɺςετڥࣗͰ ༻ҙ͢Δ͔͠ͳ͍ͷ͔
ͱݴ͑ɺ͜͏͍͏ؔͩ͠ʜ
·ͣangular-cliͰ༻ҙ͞ΕΔ ςετڥΛݟͯΈΔ
1. Angularͷςετڥ
package.jsonͷҰ෦ൈਮ
package.jsonͷҰ෦ൈਮ
Tools • ςετϑϨʔϜϫʔΫ㱺ɹ • E2EςετϑϨʔϜϫʔΫ㱺ɹ • ςετϥϯφʔɹ㱺ɹ • ରϒϥβɹ㱺ɹ ※
ରϒϥβՃՄೳ
؆୯ʹղઆ͠·͢
• ςετϑϨʔϜϫʔΫ㱺ɹ • E2EςετϑϨʔϜϫʔΫ㱺ɹ • ςετϥϯφʔɹ㱺ɹ • ରϒϥβɹ㱺ɹ ※ ରϒϥβՃՄೳ
Tools
• ςετϑϨʔϜϫʔΫ㱺ɹ • E2EςετϑϨʔϜϫʔΫ㱺ɹ • ςετϥϯφʔɹ㱺ɹ • ରϒϥβɹ㱺ɹ ※ ରϒϥβՃՄೳ
Tools
Tools • ςετϑϨʔϜϫʔΫ㱺ɹ • E2EςετϑϨʔϜϫʔΫ㱺ɹ • ςετϥϯφʔɹ㱺ɹ • ରϒϥβɹ㱺ɹ ※
ରϒϥβՃՄೳ
How to write test, or policy • جຊcomponentຖʹςετΛॻ͘ • ςετίʔυͷϑΝΠϧ໊ʮ*.spec.tsʯ
• Service ClassserviceຖʹςετΛॻ͘ • UIʢσβΠϯʣʹ͍ͭͯςετॻ͔ͳ͍
Test File Name Example ֤ίϯϙʔωϯτຖ ʹ.spec.tsϑΝΠϧΛ࡞Δɻ
Component Class Test Example ಄ͰඞཁͳϞδϡʔ ϧΛಡΈࠐΈɺς ετίʔυͷલʹ DIͨ͠ΓίϯύΠϧ ͢Δ
Service Class Example ServiceΫϥεͳΔ͘ γϯϓϧʹɻ Angularʹґଘ͠ͳ͍ ͱɺී௨ͷΦϒδΣΫτ ͱͯ͠ςετ͕ॻ͚Δɻ
Service Class Test Example ςετ͜Μͳײ͡ɻ
৭ʑπʔϧͷΛ͕ͨ͠
͜ͷࢠΛར༻͢Δ͚ͩͰ ςετΓ͏Δ
Feature of TypeScript • ܕ͕͋Δ • ObjectͷதΛఆٛͰ͖Δ ɹˠɹίϯύΠϧ࣌ʹΤϥʔΛݴͬͯ͘ΕΔ͔Β
2. Ionic Teamͷ Ϣχοτςεταϯϓϧ
Ionic Team͕Githubʹ ςετ༻ͷαϯϓϧϦϙδτϦ Λެ։͍ͯ͠Δɻ
None
ىಈͯ͠ΈΔͱ͜Μͳײ͡ɻ
ionic-unit-testing-example
ionic-unit-testing-example
ςετڥʁ
package.jsonͷҰ෦ൈਮ
͍͍ͩͨAngularͱಉ͡
Comparison of Angular and Ionic app/ ᵓ … ᵓ package.json
ᵓ e2e/ ᵓ karma.conf.js ᵋ src/ ɹᵋ app/ app/ ᵓ … ᵓ package.json ᵓ e2e/ ᵓ test-config ɹᵋ karma.conf.js ଞ ᵋ src/ ɹᵋ app/ Angular Ionic
Comparison of Angular and Ionic Angular
Comparison of Angular and Ionic Ionic
Comparison of Angular and Ionic Ionic Ionic ಠࣗͷϞδϡʔϧɺίϯϙʔωϯτΛ ಡΈࠐΉඞཁ͕͋Δ
3. Nativeػೳͷςετ
None
ࠓIonic Nativeͱͯ͠ ػೳ͕࣮͞Ε͍ͯΔ❗
Usage native module # install $ ionic cordova plugin add
cordova-plugin-camera $ npm i —save @ionic-native/camera
͔͠͠ɺNativeͷػೳ ࣮ػͰςετͤ͟ΔΛಘͳ͍ʜ
Example: Camera Plugin ϒϥβͰNativeͷػೳ͕ͳ͍ͨΊɺͲ͏ͯ͠ ࣮ػͰͷ֬ೝ͕ඞཁʜ ʁ
ղܾࡦ͋Δํ͝ڭࣔئ͍·͢❗
sample application
IonicͰ؆୯ͳΞϓϦΛ ̍ͭ࡞Γ·ͨ͠ɻ
Pick Lunch Menu https://k-kuwahara.github.io/pick- lunch-menu/
Pick Lunch Menu
Summary
Summary • ςετॻ͚ΔͳΒॻ͍ͨ΄͏͕ྑ͍ • ࠔͬͨΒAngularͷςετΛਅࣅ͢Δ ɹ˞ڊਓͷݞʹͬͨ΄͏ָ͕ • ωΠςΟϒػೳIonic NativeΛ͓͏
Reference URL • ʮionic-unit-testing-exampleʯ ɹɹhttps://github.com/ionic-team/ionic-unit-testing-example • ʮionicͷςετڥΛௐͨʯ ɹɹhttp://qiita.com/bnosuke/items/7f14c169429c9196f7fb • ʮIonic
+ Typescript + Protractor Ͱe2eςετΛ͢Δʯ ɹɹhttp://qiita.com/takeo-asai/items/ee7c15e5c5cfc9cf3124 • ʮTesting Angular Appʯ ɹɹhttps://speakerdeck.com/quramy/ng-japan-testing-angular-app
Ҏ্ɺ͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠❗