WonderAgentPlay

← Blog

Last updated 2026-10-14

Muse-Wonder Unit Test Generation

Prompt pattern for generating Vitest unit tests with muse-wonder-1.0 online — sample function, expected workflow, and honest limitations.

Unit test generation is one of the three phase-one templates. Use it to draft Vitest-style tests for a pure function, then run those tests in your own CI — this site does not execute tests for you.

Methodology

  1. Open the playground and click Unit tests.
  2. Cap max output tokens (template default is 3000; lower if you only need a sketch).
  3. Copy highlighted code blocks into a local Vitest project.
  4. Run vitest locally and record pass/fail — never invent pass rates here.

Sample input

ts
export function parseCreditPack(input: string): { dollars: number; tokens: number } | null {
  const m = /^\$(\d+(?:\.\d+)?)\s*→\s*(\d[\d,]*)\s*tokens$/i.exec(input.trim());
  if (!m) return null;
  return { dollars: Number(m[class="tok-number">1]), tokens: Number(m[class="tok-number">2]!.replace(/,/g, class="tok-string">"")) };
}

Ask for happy path, commas in tokens, invalid formats, and empty string cases with arrange-act-assert.

Result

Not yet live-verified: Generated suites from the live model have not been recorded as pass/fail on this domain yet. Below is the *evaluation checklist* we use after a live run — not a fabricated scoreboard.

  • Does the suite import the function under test correctly?
  • Are edge cases covered without mocking unrelated network APIs?
  • Does the code compile under TypeScript strict mode?

Mark individual asserts as pass/fail only after a real local run on a dated transcript.

Limitations

  • No sandboxed test runner in the playground.
  • Long generated suites burn output tokens quickly — check remaining free/daily or prepaid credits first.
  • Active-Memory is not available; clearing session wipes local history.
  • No fake benchmarks, latency charts, or affiliate links.

Last verified

2026-10-14 — template + methodology reviewed; live generation quality and Vitest pass rates remain unverified.

Try the related flow on the playground.

Muse-Wonder Unit Test Generation · WonderAgentPlay