Tests
The tests, one file for each part of the source.
Code
- apply.test.ts
Runs the read, write and read-back loop on parts that stand in for GitHub and Cloudflare, so each way a write can end is reported as it happened: fixed, still off, failed or left. A part already in line is never written.
- cli.test.ts
Runs
craftz checkandcraftz fixfrom source on a package thatpnpm newwrites, after taking itsprepackscript out. check has to name the rule and fail, and fix has to put it back, so the command andpnpm aligncan't disagree on what a fix does. - index.test.ts
Holds
craftz()to never overriding the repository. Each case merges what the plugin returns into a config, the way Vite does. Unset keys are filled in and the repository's own stay. - new.test.ts
Writes a package, a site, a package with a site, scripts in a private repository and an internal site in a public one, the way
pnpm newdoes. Each is checked against the survey and runs itsverify. If the rules change and the generator doesn't follow, this fails here, before a new repository starts out of line. - pr.test.ts
Holds
craftz prandcraftz goneto what they read from git and the notes config, without running git. The fix that moves a repository onto them is tested too, since it deletes files. - rules.test.ts
Holds the rules and rules.ts to the same ids, so a rule can't be stated without a check, or checked without being stated. Every check, with an id or not yet, is under one of the doc's parts.
- status.test.ts
Holds what
craftz statusreads to the lines it prints: the latest run of each workflow, a build that's running or done, and npm's version next to the package's. Reading GitHub, npm and Cloudflare is left to running it.