Implementing a robust unit testing framework for the core `lib/` codebase of M3E Canvas. This directly impacts the reliability and maintainability of the project's foundational logic, including prompt generation and layout algorithms.
Raw Developer Origin & Technical Request
GitHub Issue
Sep 4, 2026
### What are you trying to do
The repo has no test suite today; CI runs typecheck and build only. The pure logic in `lib/` is the most valuable and most testable part of the codebase:
- `lib/prompt.ts` – prompt generation per language / target platform (the project's core output)
- `lib/tidy.ts` – layout auto-arrangement
- `lib/color.ts` – M3 scheme generation from a seed color
- `lib/shapes.ts` / `lib/tokens.ts` – geometry and corner math
Regressions here (e.g. a wording change breaking prompt structure, or a tidy edge case) are silent today.
### What would help
A contributor can run `npm test` locally and get fast results for the pure
`lib/` logic; every PR then runs the same tests in the existing `check` job
in `ci.yml`, alongside typecheck and build.
Proposed change:
1. Add Vitest (dev-only, TS-native, fast, no extra config burden) with an `npm test` script
2. Start with a small, focused set of unit tests for the pure functions above — no DOM/component tests in the first PR
3. Add `npm test` to the existing `check` job in `ci.yml`
Happy to send the PR. Scope questions before I start:
- Vitest OK, or do you prefer another runner (e.g. Node's built-in `node:test`)?
- Any preference on snapshot vs. assertion-based tests for `prompt.ts`?
### Area
Other
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from lnkiai/m3e-canvas.
Frequently Asked Questions
Market intelligence mapped to Implementing a robust unit testing framework for the core `lib/` codebase of M3E Canvas. This directly impacts the reliability and maintainability of the project's foundational logic, including prompt generation and layout algorithms..
What is the technical positioning of Implementing a robust unit testing framework for the core `lib/` codebase of M3E Canvas. This directly impacts the reliability and maintainability of the project's foundational logic, including prompt generation and layout algorithms.?
How is the developer community reacting to Implementing a robust unit testing framework for the core `lib/` codebase of M3E Canvas. This directly impacts the reliability and maintainability of the project's foundational logic, including prompt generation and layout algorithms.?
What are the foundational technologies related to Implementing a robust unit testing framework for the core `lib/` codebase of M3E Canvas. This directly impacts the reliability and maintainability of the project's foundational logic, including prompt generation and layout algorithms.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like build and npm test by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics