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
Ionic(Angular)初心者のテスト奮闘記
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kkeeth
August 05, 2017
Programming
1.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ionic(Angular)初心者のテスト奮闘記
テストの必要性、IonicとAngularのテスト環境の比較、Nativeのテストなどを話します。
kkeeth
August 05, 2017
More Decks by kkeeth
See All by kkeeth
Programming to play with p5.js
clown0082
0
110
とある EM の初めての育休からの学び
clown0082
1
5.9k
The history of Javascript frameworks: changes in front-end design philosophy
clown0082
2
250
Visually experience the beauty of mathematics with p5.js
clown0082
1
3.4k
Rediscover the joy of coding with Creative Coding
clown0082
0
2k
全員が意思決定する会社で開発者体験や生産性を見る大変さについて
clown0082
0
670
JavaScript × Mathematics go to Digital Art
clown0082
1
470
In-house study group at YUMEMI
clown0082
0
240
Playing Ionic Logo by p5.js
clown0082
0
360
Other Decks in Programming
See All in Programming
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
280
iOSDC2026登壇資料.pdf
riofujimon
0
170
AI活用は、個人から組織へ|マルチプレイヤーエージェントハーネス「QM」の社内活用事例 / AI use is moving from individuals to orgs
rkaga
1
110
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
230
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
130
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
430
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
7.3k
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
490
XHTMLが残したもの
yosuke_furukawa
PRO
2
810
WebAssembly in Android Apps 〜 WASMはJNIの夢を見るか
keiji
1
110
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
140
Are APIs Still Relevant in the AI Era?
soyuka
0
250
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Utilizing Notion as your number one productivity tool
mfonobong
4
590
Balancing Empowerment & Direction
lara
6
1.3k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
700
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Six Lessons from altMBA
skipperchong
29
4.5k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
890
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
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
Ҏ্ɺ͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠❗