Alex2Node/test
David c340e11f6f test: a failed build leaves dist/ as it was
scripts/build.mjs and its commit message state that a failed build does not touch dist/. That held when checked by
hand, and no test covered it, so a later change to the swap could break it unnoticed.

test/build.test.js runs a copy of the script in a temporary package with one source file and the dist/ of an
earlier build, and compares every file and directory of that package before and after. Two cases: a type error
(the first compiler run fails, TS2322) and "export =" (CommonJS compiles, the ES module run fails with TS1203, so
the staging directory already holds cjs/ and types/).

Checked in a scratch copy: with the cleanup of the staging directory removed both tests fail; with cjs/ and types/
swapped in before the ES module run the second one fails. npm test: 27 pass in 5.7 s.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 14:34:53 +00:00
..
fixtures build: the ES module build gets its own declarations 2026-09-28 14:31:34 +00:00
helpers test: read an ErrorResponse off the broker; every answer has its own messageId 2026-09-28 14:26:44 +00:00
build.test.js test: a failed build leaves dist/ as it was 2026-09-28 14:34:53 +00:00
change-report.test.js test: read an ErrorResponse off the broker; every answer has its own messageId 2026-09-28 14:26:44 +00:00
connection.test.js build: dual CJS/ESM output, ES2020 target, Node 18 floor 2026-09-28 13:58:17 +00:00
directives.test.js test: read an ErrorResponse off the broker; every answer has its own messageId 2026-09-28 14:26:44 +00:00
discovery.test.js build: dual CJS/ESM output, ES2020 target, Node 18 floor 2026-09-28 13:58:17 +00:00
packaging.test.js build: the ES module build gets its own declarations 2026-09-28 14:31:34 +00:00
packaging.test.mjs test: read an ErrorResponse off the broker; every answer has its own messageId 2026-09-28 14:26:44 +00:00
typings.test.js build: dual CJS/ESM output, ES2020 target, Node 18 floor 2026-09-28 13:58:17 +00:00