Repository navigation
how to contribute testing
MyPrompt uses two runners. Vitest covers unit and renderer logic. Playwright drives the built Electron shell end to end.
Configuration is vitest.config.ts: environment: 'jsdom', globals: true, and include: ['__tests__/**/*.test.ts']. The @vitejs/plugin-react and an @ alias that resolves to the capsule root let tests import product code the same way desktop/main.ts does.
Suites live under __tests__/:
| Directory | Files |
|---|---|
optimizer/ |
clarification.test.ts, coding-brief-format.test.ts, coding-brief-generation.test.ts, coding-brief-refinement.test.ts, coding-brief-v3.test.ts, optimizer-quality.test.ts, provider-stream.test.ts, super-prompt-format.test.ts
|
desktop/ |
console-theme.test.ts, console-transcript.test.ts, optimizer-failure.test.ts, system-hud.test.ts, window-drag.test.ts
|
llm/ |
provider-readiness.test.ts |
compiler/ |
compiler-profiles.test.ts |
The optimizer/ suite exercises the Super Prompt format, the Coding Brief format/generation/refinement/v3 validator path, clarification rounds, optimizer quality, and streaming. The desktop/ suite covers the console theme and transcript, the failure taxonomy, the system HUD stats, and window drag behavior. The llm/ suite checks provider readiness resolution. The compiler/ suite checks the Claude, Codex, Gemini, and Grok compiler profiles.
pnpm run test first runs pretest, which executes scripts/optimizer-acceptance.ts --dry-run through tsx. This validates the acceptance harness cases without making live provider calls. The full harness runs with pnpm run optimizer:acceptance or pnpm run desktop:benchmark --json.
Configuration is playwright.config.ts: testDir: './e2e', fullyParallel: false, workers: 1, reporter: 'line', timeout: 30_000. The single spec is e2e/transform.e2e.spec.ts, with screenshot baselines in e2e/transform.e2e.spec.ts-snapshots/. It launches the built dist-electron/desktop/bootstrap.js with a temporary userData directory and blanked provider keys so the boot state is identical on every machine.
Commands:
-
pnpm run test:e2ebuilds the desktop bundle, then runsplaywright test. -
pnpm run test:desktopruns onlyvitest run __tests__/desktop. -
pnpm run test:watchandpnpm run test:coveragewrap Vitest directly.
Create a file under the matching __tests__/<area>/ directory named <subject>.test.ts. Import describe, it, expect, and vi from vitest, and import product code through the @/ alias (for example @/lib/optimizer/engine). When a test must not reach a real provider, mock @/lib/llm/provider-registry with vi.mock, as __tests__/optimizer/optimizer-quality.test.ts does. The include glob picks the new file up automatically; run it with pnpm exec vitest run __tests__/<area>/<subject>.test.ts.
See Debugging for reading failures and Tooling for the runner versions.
Open-source prompt engineering and multi-LLM tooling by Sentra Artificial Intelligence.
MyPrompt develops practical approaches to prompt engineering, multi-LLM optimisation, reusable prompt systems, and AI-native workflows — with an emphasis on structured, interoperable, and real-world AI use.
Built in Indonesia as part of the Sentra Artificial Intelligence ecosystem.
Sentra Artificial Intelligence · Source Repository · Official Website
Dr Ferdi Iskandar — Creator & Maintainer
LinkedIn ·
ORCID ·
Hugging Face ·
Kaggle ·
Medium ·
Substack ·
X ·
Threads
MyPrompt · Sentra Artificial Intelligence · Indonesia