testing

A testing guide for WeftCut, a software project, that explains where different kinds of tests are stored and which commands run them. It covers unit, build-script, Rust, end-to-end, and mutation tests.

In plain words
What is it for?
Use it to find relevant tests, run TypeScript, build-script, Rust, and end-to-end checks, or run mutation testing, which changes code deliberately to see whether tests catch the change.
Why use it?
It removes the guesswork caused by tests being spread across the project instead of kept in one tests folder. It also shows which test command checks each layer.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/weftcut/weftcut/testing
Clone the repo
git clone --depth 1 https://github.com/WeftCut/WeftCut
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,467 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01467
Opus 5 $0.00000 $0.00733
Sonnet 5 $0.00000 $0.00293
Haiku 4.5 $0.00000 $0.00147

Measured yesterday against content hash a470ece4dc39, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/testing.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing

Where WeftCut's tests live, why they're split the way they are, and how to run each layer. There is no single tests/ directory — that's deliberate (see Why not one directory). Tests are grouped by runner, not scattered by neglect.

The layers

Layer Location Runner Command (cwd)
Unit (TS) colocated next to source: apps/desktop/src/{renderer,main,shared}/**/*.{test,spec}.{ts,tsx} Vitest npm test (repo root) · npm run test:watch (apps/desktop)
Build scripts colocated: apps/desktop/scripts/*.test.mjs and apps/desktop/e2e/**/*.test.mjs (the fixture generator's own suite) node:test npm run test:scripts (repo root or apps/desktop)
Rust native/** — inline #[cfg(test)] + native/tests/ cargo see Rust (repo root)
E2E apps/desktop/e2e/electron/*.spec.ts Playwright driving the real Electron app npm run e2e (repo root or apps/desktop) · add -- --full for the @matrix tier
Mutation / PBT mutates src/main/state/** (config: apps/desktop/stryker.config.mjs) StrykerJS (Vitest runner) npm run pbt:stryker (apps/desktop)

The apps/desktop unit script excludes **/*.browser.test.ts; there are none today — it's a standing guard for a pattern that would need a browser runner.

Build-script tests are a separate command on purpose. vitest.config.ts pins include to the three src/ roots, so scripts/*.test.mjs is invisible to npm test — and they are node:test, not Vitest, so widening the glob would not help. They are not folded into npm test because that script forwards extra argv (npm test -- src/foo.test.ts), and a &&-chained second command would swallow those args. CI runs both as adjacent steps on the Windows leg. Note the quoted glob in the script: node --test expands it internally, so it behaves the same under cmd.exe and sh — an unquoted glob or a bare directory argument does not work.

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 96 lines · 0 tokens per session scan A a470ece4dc39

Subscribe to this mod's changes

testing is an agent published in the GitHub repository WeftCut/WeftCut (4 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,467 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.