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
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
5k
新サービス・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
MCPをつなげて作る組織横断のAIエージェント基盤
tsubakimoto_s
0
230
QAと開発の両側から進める AI活用 -QAプロセスAI支援ツールキットと Inner Loop / Outer Loopの取り組み-
legalontechnologies
PRO
2
330
NYC Summit 2026 におけるAmazon Bedrock AgentCore のアップデート
ren8k
1
230
ここは地獄!つらい朝会を体験することで、チームとしてのより良い振る舞いに気づくワークショップ / The stand-up meeting from hell in the game industry
scrummasudar
0
400
DevOps Agentで運用判断をチーム資産にする~Agent InstructionsとAgent Skillを継続的に育てる~
fujioka6789
0
160
なぜ、あなたのエージェントは言うことを聞かないのか
segavvy
1
560
人依存からAIネイティブの体制へ:バックエンド開発の裏側【SORACOM Discovery 2026】
soracom
PRO
0
120
reFACToring
moznion
1
810
AI驚き屋発見器
yama3133
1
380
実践が先生だった— 新卒サーバーエンジニア1年目のリアル
mixi_engineers
PRO
0
180
QA・ソフトウェアテスト研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
3
1.6k
Vポイント分析基盤におけるデータモデリング20年史
taromatsui_cccmkhd
4
790
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Balancing Empowerment & Direction
lara
6
1.2k
Docker and Python
trallard
47
4k
Navigating Team Friction
lara
192
16k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
160
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
530
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Building Applications with DynamoDB
mza
96
7.1k
ラッコキーワード サービス紹介資料
rakko
1
4.1M
Ethics towards AI in product and experience design
skipperchong
2
330
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