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
Meteor 1.3 Testing (beta)
Search
Nobutaka OSHIRO
March 06, 2016
Technology
2
1.3k
Meteor 1.3 Testing (beta)
2016.3.6 の Meteor 勉強会の発表資料です。
Nobutaka OSHIRO
March 06, 2016
Tweet
Share
More Decks by Nobutaka OSHIRO
See All by Nobutaka OSHIRO
190828 VSCode + Remote Development ExtensionでElm爆速開発環境構築
notakaos
0
130
GraphQL勉強会 2017.6.7
notakaos
5
970
Other Decks in Technology
See All in Technology
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
540
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
530
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
20241220_S3 tablesの使い方を検証してみた
handy
4
400
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
150
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
100
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
110
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
330
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
222
9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
The World Runs on Bad Software
bkeepers
PRO
65
11k
4 Signs Your Business is Dying
shpigford
181
21k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
How GitHub (no longer) Works
holman
311
140k
Visualization
eitanlees
146
15k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Thoughts on Productivity
jonyablonski
67
4.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Transcript
Meteor 1.3 Tes,ng 3/6 Meteor ษڧձ in ΪʔΫΦϑΟεܙൺण େ ৴
(OSHIRO, Nobutaka)
Who? • גࣜձࣾJ-hack CTO݉ϓϩάϥϚʔ • MeteorΞϓϦاըɾ։ൃɾӡ༻ɾอक • Meteorྺ 10ϲ݄ •
Twi5er: @notanota • GitHub: @nobutakaoshiro • Qiita: @n-oshiro
My Recent Ac*vity • 2016 • 1/23: Meteorษڧձൃද • 1/30:
Meteor iOSΞϓϦ։ൃϋϯζ Φϯओ࠵ • 3/6: Meteorษڧձൃද <- ͍·͜͜
Meteor 1.3 Tes,ng
ຊͷൃද༰ Meteor 1.3-beta.12 Λجʹ͍ͯ͠·͢ɻ Metoer 1.3 ਖ਼ࣜϦϦʔε࣌ʹ༷͕มΘΔՄೳੑ͕͋Γ·͢ɻ
ΞδΣϯμ • ςετͱ • ςετछྨʹ͍ͭͯ • Tes%ng in Meteor 1.3ɹ
• Full app tes%ng & Module tes%ngɹ • DEMOɹ
ςετͱ ιϑτΣΞςετʢso#ware testʣɺίϯϐϡʔλͷϓϩά ϥϜΛ࣮ߦ͠ɺਖ਼͘͠ಈ࡞͢Δ͔ɺඪͱ࣭ͨ͠ʹ౸ୡ͍ͯ͠ Δ͔ɺҙਤ͠ͳ͍ಈ࡞Λ͠ͳ͍͔Ͳ͏͔Λ֬ೝ͢Δ࡞ۀͷ͜ͱͰ ͋Δɻ — ιϑτΣΞςετ - Wikipedia
ςετΛॻ͘͜ͱͰ... • ߴ࣭ͳ(όάͷগͳ͍)ঢ়ଶΛҡ࣋Ͱ͖Δ • ίʔυͷमਖ਼͕༰қʹͳΔ • ࣗ৴Λ࣋ͬͯίʔυͷϦϑΝΫλϦϯά͕Ͱ͖Δ • όάͷൃݟʹͭͳ͕Δ •
ظ͞ΕΔಈ࡞ΛυΩϡϝϯτԽͰ͖Δ
ςετछྨ(1/2) • ୯ମςετ (Unit test) • ͋ΔϞδϡʔϧ͕ਖ਼͘͠ಈ࡞͢Δ͔Λ͔֬ΊΔ • ݁߹ςετ(Integra.on test)
• ෳϞδϡʔϧ͕ڠௐͯ͠ਖ਼͘͠ಈ͘͜ͱΛ͔֬ΊΔ • ड͚ೖΕςετɺe2eςετ(Acceptance or end-to-end test) • ΞϓϦશମͷಈ࡞ΛϒϥβϨϕϧͰݕূ͢Δ
ςετछྨ(2/2) • ෛՙςετ (Load test, Stress test) • ෛՙΛ͔͚ΔͱͲ͏ͳΔͷ͔ɺͲ͜·Ͱ͑ΒΕΔͷ͔Λ֬ ೝ͢Δ
• ܧଓతΠϯςάϨʔγϣϯςετ (Con0nuous Integra0on test) • ఆظతɺίϛοτ୯ҐͰςετΛ࣮ߦ͢Δ͜ͱͰෆ۩߹Λૣ ظൃݟ͠ɺΤϥʔ͕ແ͍ঢ়ଶΛอͭ
Tes$ng in Meteor 1.3
Tes$ng in Meteor 1.3 (1/3) • meteor create ࣌ʹ package.json
ͱ tests.js ͕ࣗಈੜ͞Ε ΔΑ͏ʹͳͬͨ • Meteor 1.3 ͰσϑΥϧτͰ mocha ͱ Chai ͕༻Մೳ • prac7calmeteor:mocha package ͷՃ • prac7calmeteor:chai package Ұॹʹಋೖ͞ΕΔ
Tes$ng in Meteor 1.3 (2/3) // tests.js import assert from
"assert"; import { name as appName } from "./app.js"; describe("app", () => { it("should export its name", () => { assert.strictEqual(appName, "app"); }); });
Tes$ng in Meteor 1.3 (3/3) • Meteor 1.3 ͷ Module
ػೳͰςετ͕؆୯͔ͭಡΈ͘͢ॻ͚ Δ • ৽͍͠ meteor test ίϚϯυͷՃ • Meteor 1.3 ͔Β tests/ σΟϨΫτϦ֎ʹஔ͍ͯ͋Δ *.app- test[s].*, *.tests.* ͷϑΝΠϧࣗಈతʹಡΈࠐ·Εͳ ͍Α͏ʹͳͬͨ
Full app tes*ng & Module tes*ng
# Full app testing (integration test) meteor test --full-app --driver-package
<driver-package> # Module testing (Unit test) meteor test --driver-package <driver-package>
DEMO
# Install Meteor curl https://install.meteor.com/ | sh # Create Meteor
app meteor create app --release 1.3-beta.12 cd app # Install node_modules npm install # Run meteor app meteor # Run meteor test meteor test --driver-package practicalmeteor:mocha --port 3100 ./ meteor test --full-app --driver-package practicalmeteor:mocha --port 3100 ./
Conclusion • Meteor 1.3 ͔Β mocha ͱ chai ͕σϑΥϧτͰར༻Մೳʹ •
Module ػೳͰςετ͕ॻ͖͘͢ͳͬͨ • Meteor 1.3 ͷϕʔλ൛ͷͨΊɺࠓޙ༷͕มߋ͞ΕΔ͔͠Ε ͳ͍ͷͰࠓޙͷಈʹ
References • Meteor Guide v1.3 Migra2on (Dra6) h9p:/ /guide.meteor.com/v1.3/1.3-migra2on.html •
Meteor Guide tes2ng.md (Dra6) h9ps:/ /github.com/meteor/guide/blob/tes2ng-modules-content/ content/tes2ng.md • GitHub - meteor/todos h9ps:/ /github.com/meteor/todos
ࠂ
ʦ࿕ใʧ͜͏ͬͯReactΛMeteor1.3Ͱ͏ΜͩϋϯζΦϯʂ h"p:/ /meteor-tokyo.connpass.com/event/27388/ 3/26() 13:00-17:30 ։࠵༧ఆ
Q&A
THANK YOU!