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
Dive into vue-test-utils ~~Road of 1.0.0~~
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
pipopotamasu
June 24, 2019
Technology
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Dive into vue-test-utils ~~Road of 1.0.0~~
pipopotamasu
June 24, 2019
More Decks by pipopotamasu
See All by pipopotamasu
How JS Works
pipopotamasu
0
230
vue-function-tester
pipopotamasu
2
1.3k
medpacker_introduction_20190523
pipopotamasu
0
530
Introduction of medpacker: RoR Frontend Boilerplate
pipopotamasu
0
5.1k
新サービス・JOURNAL(ジャーナル)開発秘話
pipopotamasu
2
310
メドピアにおけるライブラリアップデート_MedBeer_20180912.pdf
pipopotamasu
0
12k
MedPeer_JapaxTaxi_MeetUp_Actioncable
pipopotamasu
0
730
MedPeer X みんなのウェディング合同勉強会
pipopotamasu
0
1.2k
UXBridge_vol3_pipopotamasu
pipopotamasu
2
930
Other Decks in Technology
See All in Technology
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.2k
[ChatGPT Work LT]事務作業が苦手な人のための バックオフィスの「半」自動化
chimaki_iot
0
310
猫付きpingコマンドを自作
uyuki234
0
250
Breaking the Seal: Static Deobfuscation of Compiled V8 JavaScript Bytecode Malware
hshrzd
0
860
Agent 時代の Kaggle 展望 / kaggle-in-the-agentic-era
upura
1
810
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
FPGAが実現する遠方宇宙の高空間分解能天体撮影 -大型地上望遠鏡の視力を補正する「補償光学」とは?-
komei_mt
0
400
その“隠したつもり”が命取り ── 自前と平文をやめて「正解」に委ねる
kuroneko13
0
130
2026-08-05 IBM Z開発最前線!IBM Bob Premium Package for Zって何がすごいの?
yutanonaka
0
270
ブラウザ研修 2026
recruitengineers
PRO
6
1.1k
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.4k
Featured
See All Featured
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
470
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
From π to Pie charts
rasagy
0
300
Practical Orchestrator
shlominoach
191
12k
Become a Pro
speakerdeck
PRO
31
6.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
KATA
mclloyd
PRO
35
15k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
210
Why Our Code Smells
bkeepers
PRO
340
58k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
210
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Transcript
Dive into vue-test-utils ~~ Road of major 1.0.0 ~~ Yamato
Murakami (@pipopotamasu3) Vue.js Tokyo Drinkup#3 06/24/2019
name: Yamato Murakami, github: pipopotamasu, twitter: pipopotamasu3, company: MedPeer, Inc,
tech: [ Ruby, PHP, Vue.js, React ], hobby: Baseball
Do you know vue-test-utils?
So, what is medpacker? https://github.com/vuejs/vue-test-utils
So, what is medpacker? vue-test-utils is … vue-test-utils is the
“official” unit testing library for Vue.js
Have you used vue-test-utils?
None
None
None
None
None
Why has this been still beta?
Lets’s find out reasons!
https://github.com/vuejs/vue-test-utils/issues/246
https://github.com/vuejs/vue-test-utils/issues/246
2 blockers for ver1.0.0 *NQSPWFTVQQPSUGPSFYUFOEFEDPNQPOFOUT 'JYTZODISPOPVTCVHT
2 blockers for ver1.0.0 *NQSPWFTVQQPSUGPSFYUFOEFEDPNQPOFOUT 'JYTZODISPOPVTCVHT
Improve support for extended component
extended components?
extended components? // use Vue.extend const BaseComponent = Vue.extend({ data
() { return { lastname: 'murakami' } } }) new BaseComponent({ el: '#app', template: '<span>{{ firstname }}-{{ lastname }}</span>', data () { return { firstname: 'yamato' } } })
extended components? // use extends property const BaseComponent = {
data () { return { lastname: 'murakami' } } } new Vue({ extends: BaseComponent, el: '#app', template: '<span>{{ firstname }}-{{ lastname }}</span>', data () { return { firstname: 'yamato' } } });
Test Code
extended components? const BaseComponent = Vue.extend({ data () { return
{ lastname: 'murakami' } } }) const ChildCompoent = BaseComponent.extend({ template: '<span>{{ firstname }}-{{ lastname }}</span>', data () { return { firstname: 'yamato' } } }) describe("ChildCompoent.vue", () => { it("renders fullname", () => { const wrapper = mount(ChildCompoent); expect(wrapper.text()).toMatch('yamato-murakami'); }); });
extended components?
None
Why extended components need to improve?
None
None
None
// use Vue.extend const BaseComponent = Vue.extend({ data () {
return { lastname: 'murakami' } } })
// use Vue.extend const BaseComponent = Vue.extend({ data () {
return { lastname: 'murakami' } } }) !
None
// use Vue.extend const BaseComponent = Vue.extend({ data () {
return { lastname: 'murakami' } } }) BaseComponent.extend({ ~~~~~~~~~ some extend setting ~~~~~~~~~ })
// use Vue.extend const BaseComponent = Vue.extend({ data () {
return { lastname: 'murakami' } } }) BaseComponent.extend({ ~~~~~~~~~ some extend setting ~~~~~~~~~ }) "
None
https://github.com/vuejs/vue-test-utils/blob/dev/ packages/create-instance/create-instance.js#L76
None
https://github.com/vuejs/vue-test-utils/pull/1055
Why call `extend` twice?
Why call `extend` twice? const Component = { template: '<span></span>',
computed: { returnZero () { return 0; } } } describe("Component.vue", () => { it("override", () => { const wrapper = mount(Component, { computed: { returnZero () { return 'Override!!' } } }); expect(wrapper.vm.returnZero).toBe('Override!!'); }); });
5PJOKFDUDPNQPOFOUPQUJPOT MJLFADPNQVUFEAGSPNPVUTJEF
None
2 blockers for ver1.0.0 *NQSPWFTVQQPSUGPSFYUFOEFEDPNQPOFOUT 'JYTZODISPOPVTCVHT
2 blockers for ver1.0.0 *NQSPWFTVQQPSUGPSFYUFOEFEDPNQPOFOUT 'JYTZODISPOPVTCVHT
None
Thank you for listening!
References • https://github.com/vuejs/vue-test-utils • https://jp.vuejs.org • https://github.com/vuejs/vue
Reference Images • http://hermie.jp/ • Yoshiki HAYAMA hermie.jp • CC
BY 3.0 • https://creativecommons.org/licenses/by/ 3.0/deed.ja