
Vue Testing Best Practices
SkillVue 测试的最佳实践:推荐 Vitest 与 Vue Test Utils,以黑盒方式测组件,用 flushPromises 处理异步,给出测试组合式函数、Pinia store、异步组件与 Teleport 的方法,不只依赖快照,端到端测试推荐 Playwright。
name: vue-testing-best-practices
version: 1.0.0
license: MIT
author: github.com/vuejs-ai
description: Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.
Vue.js testing best practices, patterns, and common gotchas.
Testing
- Setting up test infrastructure for Vue 3 projects → See testing-vitest-recommended-for-vue
- Tests keep breaking when refactoring component internals → See testing-component-blackbox-approach
- Tests fail intermittently with race conditions → See testing-async-await-flushpromises
- Composables using lifecycle hooks or inject fail to test → See testing-composables-helper-wrapper
- Getting "injection Symbol(pinia) not found" errors in tests → See testing-pinia-store-setup
- Components with async setup won't render in tests → See testing-suspense-async-components
- Snapshot tests keep passing despite broken functionality → See testing-no-snapshot-only
- Choosing end-to-end testing framework for Vue apps → See testing-e2e-playwright-recommended
- Tests need to verify computed styles or real DOM events → See testing-browser-vs-node-runners
- Testing components created with defineAsyncComponent fails → See async-component-testing
- Teleported modal content can't be found in wrapper queries → See teleport-testing-complexity
Reference
相關資源

TestMu AI(LambdaTest)Agent Skills
SkillTestMu AI(原 LambdaTest)官方测试技能合集,覆盖 Selenium、Playwright、Cypress、Appium、pytest、JUnit 等 40 余种框架,指导 agent 编写单元、端到端与移动端测试;可本地运行,上云端跨浏览器与真机执行需账号。
LambdaTest/agent-skills398
webapp-testing
Skill用 Python Playwright 脚本驱动本地 Web 应用做功能验证、界面调试、截图与浏览器日志查看,自带管理开发服务器启停的辅助脚本。Anthropic 官方技能。
anthropics/skills203k
Playwright CLI
SkillPlaywright 官方 CLI 的配套技能:用简短命令打开页面、点击填表、快照与截图,也能编写和调试 Playwright 测试,比 MCP 方式更省上下文。微软官方维护,需要 Node.js。
microsoft/playwright-cli15.6k
Frontend Testing Debugging
Skill测试与调试本地运行的前端页面:优先用 Codex 的 Browser 插件、没有则用 Playwright,检查空白页、框架报错与控制台错误,截图取证,改完重载复查并输出 QA 报告。OpenAI 官方维护,原 openai/skills 中的 playwright-interactive。
openai/plugins8.5k
Vitest
SkillVitest 5 测试框架的参考:配置、命令行、test / describe / expect API、生命周期钩子,模拟、快照、覆盖率、测试上下文与 fixtures、并发、过滤与标签、报告器、基准测试,以及测试环境、类型测试与多项目配置。由 Anthony Fu 从官方文档生成。
antfu/skills6.1k
Playwright Skill
Skill让 agent 即时编写并执行 Playwright 脚本完成浏览器测试与自动化:自动探测本地开发服务器,支持截图、响应式检查、登录流程与链接检查。安装后需在技能目录运行 npm run setup。
lackeyjb/playwright-skill3.3k