Skip to content
Agentmart
Submit a tool

test-coverage

Write Vitest specs for Vue 3 JavaScript (Vite Plus, happy-dom, @vue/test-utils) and analyze V8 coverage + Fallow health to prioritize test-first refactors.

Skill by scott-fryxell

IndexedMIT★ 125
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/scott-fryxell-test-coverage

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Write Vitest specs for Vue 3 JavaScript (Vite Plus, happy-dom, @vue/test-utils) and analyze V8 coverage + Fallow health to prioritize test-first refactors. Reference implementation is work/realness. Use when writing or fixing tests, mocking composables, improving coverage, or after test:coverage or npx fallow fails thresholds.

Use cases: frontend, testing, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Node.js package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/test-coverage

What's inside

Skill name
test-coverage
Description
Write Vitest specs for Vue 3 JavaScript (Vite Plus, happy-dom, @vue/test-utils) and analyze V8 coverage + Fallow health to prioritize test-first refactors. Reference implementation is work/realness. Use when writing or fixing tests, mocking composables, improving coverage, or after test:coverage or npx fallow fails thresholds.
License
MIT
Instructions
200 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (6)

  • SKILL.md
  • fallow-integration.md · references/
  • web-realness.md · references/
  • coverage-metrics.js · scripts/lib/
  • prioritize-refactor-risk.js · scripts/
  • summarize-coverage.js · scripts/

SKILL.md (first lines)

# Tests, coverage, and refactor risk

Canonical reference: **`work/realness`** (`@realness.online/web`). Run every
command below from that directory.

Match `tests/**/*.spec.js` there. Do not introduce Jest, React Testing Library, TypeScript test files, or co-located `*.test.ts`.

Two jobs:

1. **Write specs** - patterns below; detail in [references/web-realness.md](references/web-realness.md)
2. **Prioritize** - `npm run test:risk` before refactors; not a blind chase for 100%

## Stack

| Piece | What we use |
| --- | --- |
| Runner | Vite Plus - `vp test`, `import ... from 'vite-plus/test'` |
| Engine | Vitest (`vite-plus-test` alias) |
| DOM | `happy-dom` |
| Vue | `@vue/test-utils` - prefer `shallowMount` |
| Language | JavaScript + JSDoc |
| Coverage | V8, 80% global, `all: true` |

## Commands

```bash
vp test run --reporter=dot          # npm run test
vp test watch                       # npm run test:watch
vp test run --coverage              # npm run test:coverage
vp test run --bail=1 --reporter=dot # npm run test:fail-fast
npm run test:risk                   # coverage + fallow + risk report
```

Pre-commit: `vp check --fix && vp run type && vp test run`.

## Writing specs

### Layout

- All specs in `tests/**/*.spec.js` mirroring `src/` (not co-located)
- `describe('@/utils/itemid', ...)` or view/component name
- `@/` -> `src/`; `@@/` -> `tests/mocks/`
- Config: `vite.config.js` -> `test` block; setup: `tests/setup.js`, `tests/mocks/`

### Skeleton

```javascript
import { describe, it, expect, vi, beforeEach } from 'vite-plus/test'
import { fn_under_test } from '@/utils/example'

describe('@/utils/example', () => {
  beforeEach(() => {
    vi.clearAllMocks()
  })

  it('describes behavior in plain language', () => {
    expect(fn_under_test('input')).toBe('output')
  })
})
```

Test behavior, not internals (JS style: AGENTS.md).

### Key patterns

| Pattern | Approach | Reference spec |
| --- | --- | --- |
| Pure utils | Input/output, nested `describe` | `tests/utils/itemid.spec.js` |
| Module mocks | Top-level `vi.mock()`; `vi.clearAllMocks()` in `beforeEach` | `tests/utils/itemid.spec.js` |
| Vue components | `shallowMount`, stubs, semantic queries | `tests/components/account/as-notifications.spec.js` |
| Composable mocks | `vi.hoisted()` refs for `vi.mock` closures | `tests/views/Account.spec.js` |
| Composables | `with_setup()` + `mount(defineComponent(...))` | `tests/use/poster.spec.js` |
| Async errors | `await expect(...).rejects.toThrow()` | `tests/utils/itemid.spec.js` |

**Hoisted mocks** (reset `.value` in `beforeEach`):

```javascript
const { mock_status, mock_enable } = vi.hoisted(() => {
  const create_ref = value => ({ value, __v_isRef: true })
  return {
    mock_status: create_ref('off'),
    mock_enable: vi.fn().mockResolvedValue(true)
  }
})

vi.mock('@/use/push', () => ({
  use_push: () => ({ status: mock_status, enable: mock_enable })
}))
```

Global mocks: `tests/mocks/default.js`, `tests/mocks/browser/*`. Per-spec mocks only when behavior differs.

`mockReset: false` in config - mocks keep implementations; clear call history each test.

### What we do not do

| Avoid | Use instead |
| --- | --- |
| Jest / React Testing Library | `vite-plus/test` + `@vue/test-utils` |
| TypeScript test files | `.spec.js` + JSDoc |
| `@faker-js/faker` | Domain fixtures (item IDs, directories) |
| supertest / live DB | Mock `idb-keyval`, `serverless` |
| `data-testid` | Semantic DOM queries |
| 100% coverage | 80% gate + risk report |

Full patterns, templates, file map: [references/web-realness.md](references/web-realness.md)

## Coverage workflow

### 1. Risk report (start here)

```bash
npm run test:risk
# or, if reports already exist:
npm run test:risk:report
```

Runs `scripts/prioritize-refactor-risk.js`.

From scott-fryxell/brayness, MIT.

More from scott-fryxell/brayness

Signals

Stars
125
Forks
15
Open issues
0
Last commit (this folder)
Aug 9, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from scott-fryxell

Cite this page

test-coverage skill. Agent Mart. https://agentmart.dev/skills/scott-fryxell-test-coverage (last updated 2026-10-24)