Angular Testing
Kilo-Org/kilo-marketplace
Write unit and integration tests for Angular v20+ applications using Vitest or Jasmine with TestBed and modern testing patterns.
Guide for writing unit tests (Vitest), integration tests, and E2E tests (Playwright) following Mobazha project conventions.
$ npx skills add mobazha/mobazha-unified --skill testing-guide -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mobazha/mobazha-unified testing-guide --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/testing-guide .claude/skills/testing-guide && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "testing-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/testing-guide into .claude/skills/testing-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing-guide", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/testing-guideType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add mobazha/mobazha-unified --skill testing-guide -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mobazha/mobazha-unified testing-guide --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.cursor/skills/testing-guide .agents/skills/testing-guide && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "testing-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/testing-guide into .agents/skills/testing-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing-guide", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mobazha/mobazha-unified --skill testing-guide -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mobazha/mobazha-unified testing-guide --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.cursor/skills/testing-guide .cursor/skills/testing-guide && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "testing-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/testing-guide into .cursor/skills/testing-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing-guide", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/mobazha/mobazha-unified.git --path .cursor/skills/testing-guide--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add mobazha/mobazha-unified --skill testing-guide -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mobazha/mobazha-unified testing-guide --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.cursor/skills/testing-guide .gemini/skills/testing-guide && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "testing-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/testing-guide into .gemini/skills/testing-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing-guide", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install mobazha/mobazha-unified testing-guideInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add mobazha/mobazha-unified --skill testing-guide -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .github/skills && cp -r skills-src/.cursor/skills/testing-guide .github/skills/testing-guide && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "testing-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/testing-guide into .github/skills/testing-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing-guide", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mobazha/mobazha-unified --skill testing-guide -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install mobazha/mobazha-unified testing-guide --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.cursor/skills/testing-guide .opencode/skills/testing-guide && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "testing-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/testing-guide into .opencode/skills/testing-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "testing-guide", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
testing-guideGuide for writing unit tests (Vitest), integration tests, and E2E tests (Playwright) following Mobazha project conventions.
Testing Guide is an agent skill from mobazha/mobazha-unified. Guide for writing unit tests (Vitest), integration tests, and E2E tests (Playwright) following Mobazha project conventions. Use when writing tests, setting up test files, or asking about testing strategies, "写测试", "测试", "单元测试", "E2E测试", "集成测试", "测试覆盖率".
Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA, covering Unit testing, End-to-end testing and Browser testing. It works with Playwright and Vitest. The repository describes itself as: Open-source commerce frontend for storefronts, marketplaces, checkout, and seller management. The licence is MPL-2.0.
Read from SKILL.md and the folder at commit 156c699. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pnpmFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Testing Guide loads about 1.7k tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 150 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from mobazha/mobazha-unified at commit 156c699, republished under its MPL-2.0 licence (© mobazha). 150 words, ~1,661 tokens.
.claude/skills/testing-guide/SKILL.md (or your agent's skills folder).Mobazha 项目的测试策略、模式和最佳实践。
┌─────────┐
│ E2E │ 少量关键路径 (Playwright)
┌┴─────────┴┐
│ 集成测试 │ API + Store 联动 (Vitest)
┌┴───────────┴┐
│ 单元测试 │ hooks/utils/transforms (Vitest)
└─────────────┘覆盖率目标:核心逻辑(hooks、utils、transforms)> 80%
| 层级 | 工具 | 目录 |
|---|---|---|
| 单元测试 | Vitest + jsdom | packages/core/__tests__/ |
| 集成测试 | Vitest | packages/core/__tests__/integration/ |
| E2E 测试 | Playwright | apps/web/e2e/ |
packages/core/__tests__/
├── setup.ts # 全局 setup(localStorage mock 等)
├── utils/
│ └── performance.test.ts # 工具函数测试
├── services/
│ └── api/
│ └── orders.test.ts # API 服务测试
└── i18n/
└── i18n.test.ts # i18n 测试import { describe, it, expect, vi, beforeEach } from 'vitest';
import { renderHook, act } from '@testing-library/react';
describe('useOrderDetail', () => {
beforeEach(() => {
vi.clearAllMocks();
});
it('应返回订单详情数据', async () => {
const { result } = renderHook(() => useOrderDetail('order-123'));
await waitFor(() => {
expect(result.current.displayOrder).toBeDefined();
expect(result.current.isLoading).toBe(false);
});
});
it('应正确处理错误状态', async () => {
vi.mocked(ordersApi.getOrder).mockRejectedValue(new Error('网络错误'));
const { result } = renderHook(() => useOrderDetail('invalid'));
await waitFor(() => {
expect(result.current.error).toBeTruthy();
});
});
});describe('transformCoreOrder', () => {
it('应将买家角色正确映射', () => {
const result = transformCoreOrder({
coreOrder: mockOrder,
currentUserPeerID: 'buyer-peer-id',
});
expect(result.userRole).toBe('buyer');
expect(result.canDispute).toBe(true);
});
});import { act } from '@testing-library/react';
describe('useCartStore', () => {
beforeEach(() => {
// 重置 store
useCartStore.setState({ items: [], error: null });
});
it('应正确添加商品', () => {
act(() => {
useCartStore.getState().addItem(mockItem);
});
expect(useCartStore.getState().items).toHaveLength(1);
expect(useCartStore.getState().getItemCount()).toBe(1);
});
});项目使用 skipIfNoIntegration() 辅助函数,需要后端运行时才执行:
import { skipIfNoIntegration } from '../setup';
describe('Orders Integration', () => {
skipIfNoIntegration();
it('应完成完整的购买流程', async () => {
// 创建订单
const order = await ordersApi.createOrder(mockPurchase);
expect(order.id).toBeDefined();
// 确认订单
await ordersApi.confirmOrder(order.id);
// ...
});
});import { test, expect } from '@playwright/test';
test.describe('首页', () => {
test('应正确显示导航栏', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('navigation')).toBeVisible();
await expect(page.getByTestId('search-input')).toBeVisible();
});
test('响应式:移动端应显示汉堡菜单', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 667 });
await page.goto('/');
await expect(page.getByTestId('mobile-menu-button')).toBeVisible();
});
});data-testid 定位元素,禁止 CSS 选择器getByRole、getByText 作为辅助定位项目维护桌面端和移动端的视觉快照测试,分为 Public(公开页面)和 Authenticated(已登录页面)两组:
| 测试文件 | 设备 | 用途 |
|---|---|---|
desktop-visual.spec.ts | Chromium 1280×720 | 桌面端视觉快照 |
mobile-visual.spec.ts | Mobile Chrome (Pixel 5) | 移动端视觉快照 |
ux-audit.spec.ts | Chromium 1280×720 | 桌面端 UX 审计(深度) |
mobile-ux-audit.spec.ts | iPhone 12 390×844 | 移动端 UX 审计 |
e2e/fixtures/)| 文件 | 职责 |
|---|---|
auth.ts | Casdoor 登录 + Onboarding 自动完成 + loginAndSetup() |
mock-api-routes.ts | Mock API 响应(订单/通知/搜索/商品详情/地址),确保已登录页面有数据显示 |
seed-visual-data.ts | 通过 API 创建测试商品 + 注入购物车到 localStorage |
已登录页面测试模式:
import { loginAndSetup } from './fixtures/auth';
import { mockOrdersAPI, mockNotificationsAPI } from './fixtures/mock-api-routes';
test.describe('Authenticated Pages', () => {
test.beforeAll(async ({ browser }) => {
const page = await browser.newPage();
await loginAndSetup(page);
// 保存认证状态...
});
test('orders page', async ({ page }) => {
await mockOrdersAPI(page); // 拦截 API 返回 mock 数据
await page.goto('/orders/purchases');
await expect(page).toHaveScreenshot('orders-purchases.png');
});
});Mock 最佳实践:
route.fallback()storageState 在测试间共享,避免重复登录# 桌面端
pnpm --filter @mobazha/web exec playwright test desktop-visual --project=chromium
# 移动端
pnpm --filter @mobazha/web exec playwright test mobile-visual --project="Mobile Chrome"
# 更新快照
pnpm --filter @mobazha/web exec playwright test desktop-visual --update-snapshots# 单元测试
pnpm --filter @mobazha/core test
# 带覆盖率
pnpm --filter @mobazha/core test -- --coverage
# E2E 测试
pnpm --filter @mobazha/web test:e2e
# 单个文件
pnpm --filter @mobazha/core test -- orderTransform.test.ts| 场景 | 方式 |
|---|---|
| API 调用 | vi.mock('@mobazha/core/services/api') |
| Zustand Store | useStore.setState({...}) 直接设置状态 |
| localStorage | 全局 setup 中已 mock |
| 网络请求 | 优先用 vi.mock,复杂场景用 MSW |
| 时间相关 | vi.useFakeTimers() |
describe('when X') → it('should Y'))?beforeEach 中重置?test.skip 不带注释?© mobazha, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .cursor/skills/testing-guide of mobazha/mobazha-unified.
Open the folder on GitHubat commit 156c699
Testing Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Testing Guide this skillmobazha/mobazha-unified | 165 | — | ~1.7k | Automated safety check: Pass | MPL-2.0 | |
| Angular TestingKilo-Org/kilo-marketplace | 189 | — | ~2.9k | Automated safety check: Pass | MIT | |
| Web Testing with Playwright and Vitestwithkynam/vibecode-pro-max-kit | 1.1k | — | ~892 | Automated safety check: Pass | Apache-2.0 | |
| Dotnet Testingnovotnyllc/dotnet-artisan | 233 | — | ~972 | Automated safety check: Pass | MIT | |
| Vue Testing Best PracticesJetBrains/skills | 363 | 7 repos | ~563 | Automated safety check: Pass | MIT | |
| Front End Testingcitypaul/.dotfiles | 739 | — | ~6.2k | Automated safety check: Pass | Custom licence |
Kilo-Org/kilo-marketplace
Write unit and integration tests for Angular v20+ applications using Vitest or Jasmine with TestBed and modern testing patterns.
withkynam/vibecode-pro-max-kit
Covers web testing from unit to E2E, load, visual, accessibility and security checks, with Playwright, Vitest and k6 guides plus a Playwright setup script.
novotnyllc/dotnet-artisan
Defines .NET test strategy and implementation patterns across xUnit v3 (Facts, Theories, fixtures, IAsyncLifetime), integration testing (WebApplicationFactory, Testcontainers), Aspire testing…
JetBrains/skills
A skill your agent uses for Vue.js testing. An agent skill from JetBrains/skills.
citypaul/.dotfiles
Behavior-driven UI testing patterns across Vitest Browser Mode, Playwright E2E evidence boundaries, and DOM Testing Library.
CloudAI-X/claude-workflow-v2
Designs and implements testing strategies for any codebase. An agent skill from CloudAI-X/claude-workflow-v2.
mobazha/mobazha-unified
Accessibility guide for Mobazha following WCAG 2.1 AA standards including color contrast, reduced motion, ARIA patterns, keyboard navigation, focus management, and screen reader testing.
mobazha/mobazha-unified
Look up Mobazha backend API endpoints, request/response formats, and field mappings.
mobazha/mobazha-unified
Review code for quality, architecture consistency, and adherence to Mobazha project standards using confidence-based filtering.
mobazha/mobazha-unified
Simplify and refine recently written code for clarity, consistency, and maintainability while preserving all functionality.
mobazha/mobazha-unified
Generate commit messages and run pre-commit validation following Mobazha conventions.
mobazha/mobazha-unified
Create and modify UI components following Mobazha conventions including directory structure, spacing standards, accessibility, and testing.
Works with
Categories
Guide for writing unit tests (Vitest), integration tests, and E2E tests (Playwright) following Mobazha project conventions. Testing Guide is an agent skill from mobazha/mobazha-unified. Guide for writing unit tests (Vitest), integration tests, and E2E tests (Playwright) following Mobazha project conventions.
Testing Guide fits situations like: setting up test files; asking about testing strategies.
Run `npx skills add mobazha/mobazha-unified --skill testing-guide -a claude-code`. Or copy the skill folder (.cursor/skills/testing-guide in mobazha/mobazha-unified) into .claude/skills/testing-guide in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mobazha/mobazha-unified --skill testing-guide -a codex`. Or copy the skill folder (.cursor/skills/testing-guide in mobazha/mobazha-unified) into .agents/skills/testing-guide in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mobazha/mobazha-unified --skill testing-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing-guide, .gemini/skills/testing-guide, .github/skills/testing-guide and .opencode/skills/testing-guide in your project.
Going by SKILL.md and its folder, Testing Guide needs the command-line tools its instructions call (pnpm).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Testing Guide is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.7k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Testing Guide: Angular Testing (Kilo-Org/kilo-marketplace, 189 stars), Web Testing with Playwright and Vitest (withkynam/vibecode-pro-max-kit, 1.1k stars), Dotnet Testing (novotnyllc/dotnet-artisan, 233 stars) and Vue Testing Best Practices (JetBrains/skills, 363 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
mobazha (a GitHub organization) maintains it in mobazha/mobazha-unified, which has 165 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on October 3, 2026.
Source: mobazha/mobazha-unified on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.