{"id":"38f8daff-c2d3-4582-a62d-33de7aab45d5","shortId":"4Etp8J","kind":"skill","title":"Vue Testing Best Practices","tagline":"Skills skill by Antfu","description":"Vue.js testing best practices, patterns, and common gotchas.\n\n### Testing\n- Setting up test infrastructure for Vue 3 projects → See [testing-vitest-recommended-for-vue](reference/testing-vitest-recommended-for-vue.md)\n- Tests keep breaking when refactoring component internals → See [testing-component-blackbox-approach](reference/testing-component-blackbox-approach.md)\n- Tests fail intermittently with race conditions → See [testing-async-await-flushpromises](reference/testing-async-await-flushpromises.md)\n- Composables using lifecycle hooks or inject fail to test → See [testing-composables-helper-wrapper](reference/testing-composables-helper-wrapper.md)\n- Getting \"injection Symbol(pinia) not found\" errors in tests → See [testing-pinia-store-setup](reference/testing-pinia-store-setup.md)\n- Components with async setup won't render in tests → See [testing-suspense-async-components](reference/testing-suspense-async-components.md)\n- Snapshot tests keep passing despite broken functionality → See [testing-no-snapshot-only](reference/testing-no-snapshot-only.md)\n- Choosing end-to-end testing framework for Vue apps → See [testing-e2e-playwright-recommended](reference/testing-e2e-playwright-recommended.md)\n- Tests need to verify computed styles or real DOM events → See [testing-browser-vs-node-runners](reference/testing-browser-vs-node-runners.md)\n- Testing components created with defineAsyncComponent fails → See [async-component-testing](reference/async-component-testing.md)\n- Teleported modal content can't be found in wrapper queries → See [teleport-testing-complexity](reference/teleport-testing-complexity.md)\n\n## Reference\n\n- [Vue.js Testing Guide](https://vuejs.org/guide/scaling-up/testing)\n- [Vue Test Utils](https://test-utils.vuejs.org/)\n- [Vitest Documentation](https://vitest.dev/)\n- [Playwright Documentation](https://playwright.dev/)","tags":["vue","testing","best","practices","skills","antfu"],"capabilities":["skill","source-antfu","category-skills"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/antfu/skills/vue-testing-best-practices","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under antfu/skills","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill:v1","enrichmentVersion":1,"enrichedAt":"2026-04-23T23:40:17.132Z","embedding":null,"createdAt":"2026-04-18T20:25:20.317Z","updatedAt":"2026-04-23T23:40:17.132Z","lastSeenAt":"2026-04-23T23:40:17.132Z","tsv":"'/)':198,203,208 '/guide/scaling-up/testing)':192 '3':24 'antfu':8 'app':132 'approach':46 'async':57,95,106,166 'async-component-test':165 'await':58 'best':3,11 'blackbox':45 'break':36 'broken':114 'browser':153 'category-skills' 'choos':123 'common':15 'complex':184 'compon':39,44,93,107,159,167 'compos':61,73 'comput':144 'condit':53 'content':172 'creat':160 'defineasynccompon':162 'despit':113 'document':200,205 'dom':148 'e2e':136 'end':125,127 'end-to-end':124 'error':83 'event':149 'fail':49,67,163 'flushpromis':59 'found':82,176 'framework':129 'function':115 'get':77 'gotcha':16 'guid':189 'helper':74 'hook':64 'infrastructur':21 'inject':66,78 'intermitt':50 'intern':40 'keep':35,111 'lifecycl':63 'modal':171 'need':141 'node':155 'pass':112 'pattern':13 'pinia':80,89 'playwright':137,204 'playwright.dev':207 'playwright.dev/)':206 'practic':4,12 'project':25 'queri':179 'race':52 'real':147 'recommend':30,138 'refactor':38 'refer':186 'reference/async-component-testing.md':169 'reference/teleport-testing-complexity.md':185 'reference/testing-async-await-flushpromises.md':60 'reference/testing-browser-vs-node-runners.md':157 'reference/testing-component-blackbox-approach.md':47 'reference/testing-composables-helper-wrapper.md':76 'reference/testing-e2e-playwright-recommended.md':139 'reference/testing-no-snapshot-only.md':122 'reference/testing-pinia-store-setup.md':92 'reference/testing-suspense-async-components.md':108 'reference/testing-vitest-recommended-for-vue.md':33 'render':99 'runner':156 'see':26,41,54,70,86,102,116,133,150,164,180 'set':18 'setup':91,96 'skill':5,6 'snapshot':109,120 'source-antfu' 'store':90 'style':145 'suspens':105 'symbol':79 'teleport':170,182 'teleport-testing-complex':181 'test':2,10,17,20,28,34,43,48,56,69,72,85,88,101,104,110,118,128,135,140,152,158,168,183,188,194 'test-utils.vuejs.org':197 'test-utils.vuejs.org/)':196 'testing-async-await-flushpromis':55 'testing-browser-vs-node-runn':151 'testing-component-blackbox-approach':42 'testing-composables-helper-wrapp':71 'testing-e2e-playwright-recommended':134 'testing-no-snapshot-on':117 'testing-pinia-store-setup':87 'testing-suspense-async-compon':103 'testing-vitest-recommended-for-vu':27 'use':62 'util':195 'verifi':143 'vitest':29,199 'vitest.dev':202 'vitest.dev/)':201 'vs':154 'vue':1,23,32,131,193 'vue.js':9,187 'vuejs.org':191 'vuejs.org/guide/scaling-up/testing)':190 'won':97 'wrapper':75,178","prices":[{"id":"81d03699-43f2-41c9-8b62-294add3111b2","listingId":"38f8daff-c2d3-4582-a62d-33de7aab45d5","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"antfu","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T20:25:20.317Z"}],"sources":[{"listingId":"38f8daff-c2d3-4582-a62d-33de7aab45d5","source":"github","sourceId":"antfu/skills/vue-testing-best-practices","sourceUrl":"https://github.com/antfu/skills/tree/main/skills/vue-testing-best-practices","isPrimary":false,"firstSeenAt":"2026-04-18T21:53:55.185Z","lastSeenAt":"2026-04-23T18:53:30.242Z"},{"listingId":"38f8daff-c2d3-4582-a62d-33de7aab45d5","source":"skills_sh","sourceId":"antfu/skills/vue-testing-best-practices","sourceUrl":"https://skills.sh/antfu/skills/vue-testing-best-practices","isPrimary":true,"firstSeenAt":"2026-04-18T20:25:20.317Z","lastSeenAt":"2026-04-23T23:40:17.132Z"}],"details":{"listingId":"38f8daff-c2d3-4582-a62d-33de7aab45d5","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"antfu","slug":"vue-testing-best-practices","source":"skills_sh","category":"skills","skills_sh_url":"https://skills.sh/antfu/skills/vue-testing-best-practices"},"updatedAt":"2026-04-23T23:40:17.132Z"}}