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
Truffle における JS での テスト について
Search
Katsunori Tanaka
March 23, 2018
Programming
540
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Truffle における JS での テスト について
2018/03/22(木) 第2回ブロックチェーン勉強会@東京でLTした資料です。TruffleにおけるJSでのテストについて簡単にまとめています。
Katsunori Tanaka
March 23, 2018
Transcript
17 slides
%..DPN-BCPాதࠀయ ୈճϒϩοΫνΣʔϯษڧձ!౦ژ 5SV⒐Fʹ͓͚Δ +4Ͱͷςετʹ͍ͭͯ
X © DMM.com Group ాதࠀయ ࣗݾհ ࣮࣭ ʹ+0*/ͨͯ͠ લॴଐɿϑϩϯτΤϯυ։ൃ෦
Լษڧத %..DPN-BCP εϚʔτίϯτϥΫτ։ൃ෦
X © DMM.com Group 5SV⒐FೖΕͯΈ·͢ IUUQUSV⒐FGSBNFXPSLDPN
X © DMM.com Group $ npm install -g truffle
X © DMM.com Group αϯϓϧͱͯ͠ 0⒏DJBM#PYFTͷ NFUBDPJOΛೖΕͯΈ·͢
X © DMM.com Group $ truffle unbox metacoin
X © DMM.com Group KTͷςετίʔυ UFTUNFUBDPJOKT ΛோΊͯΈ·͢
X © DMM.com Group it("should put 10000 MetaCoin in the
first account", function() { return MetaCoin.deployed().then(function(instance) { return instance.getBalance.call(accounts[0]); }).then(function(balance) { assert.equal(balance.valueOf(), 10000, "10000 wasn't in the first account"); }); }); UFTUNFUBDPJOKT
X © DMM.com Group function getBalance(address addr) public view returns(uint)
{ return balances[addr]; } .FUB$PJOTPM
X © DMM.com Group HFU#BMBODFϝιουͷ ΓͷܕVJOU ͬͯͪΖΜ+4ʹແ͍ʜ
X © DMM.com Group KTςετίʔυͰ DPOTPMFMPHଧͬͯ ࣮ࡍʹ֬ೝͯ͠Έ·͢
X © DMM.com Group function (balance) { console.log('-----------------------------------'); console.log('▼ getBalanceϝιουͷΓɿunitܕ
▼'); console.log(balance); console.log('-----------------------------------'); console.log('▼ JSͰͷܕ ▼'); console.log(typeof balance); console.log('-----------------------------------'); console.log('▼ valueOf() ͰJSϓϦϛςΟϒܕΛ֬ೝ ▼'); console.log(typeof balance.valueOf()); assert.equal(balance.valueOf(), 10000, "10000 wasn't in the first account”); }); UFTUNFUBDPJOKT
X © DMM.com Group ϙΠϯτ
X © DMM.com Group VJOUܕ͕KTςετίʔυͰɺ#JH/VNCFS0CKFDU #JH/VNCFSͷϓϦϛςΟϒܕ͕TUSJOH ͦͦςετίʔυͰɺܕνΣοΫΛ͍ͯ͠ͳ͍ ɹʢBTTFSUTUSJDU&RVBMͷํ͕ྑ͍ؾ͕͢Δʣ TPMJEJUZͰςετίʔυॻ͍ͨํ͕ྑ͍ͷ͔ͳʜʁ ɹʢ·ͩษڧෆɺ'&ΤϯδχΞʹͱ͖͍ͬͭ͢ʣ
X © DMM.com Group ࠷ޙʹ
X © DMM.com Group ·ͩ·ͩ தʂ ͬͱษڧ͠·͢ʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ 5IBOLZPVGPSZPVSLJOEBUUFOUJPO
More Decks by Katsunori Tanaka
See All by Katsunori Tanaka
DApp Questのコントラクト開発
katsunoritanaka
1
1.1k
SolidityとWeb3.jsについて
katsunoritanaka
1
770
Web3.js Development Pitfall
katsunoritanaka
1
910
Selectors Level4
katsunoritanaka
0
68
CSS Architecture with OOCSS, SMACSS, BEM
katsunoritanaka
6
430
LESS : The dynamic stylesheet language
katsunoritanaka
0
120
Other Decks in Programming
See All in Programming
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
570
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
260
Ruby から Emacs を操作したい
phigasui
0
380
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
6.1k
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
210
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
360
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
460
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
220
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
AI Augmentation Techniques with Liberty
ivargrimstad
1
550
祈るテストから、探索するテストへ 〜Lincheckではじめる並行処理テスト〜
yyh_gl
0
420
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k
Crafting Experiences
bethany
1
450
Scaling GitHub
holman
464
140k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Designing for humans not robots
tammielis
254
26k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Git: the NoSQL Database
bkeepers
PRO
433
67k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
How to Ace a Technical Interview
jacobian
280
24k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
The Cult of Friendly URLs
andyhume
79
7.1k
sira's awesome portfolio website redesign presentation
elsirapls
0
520