You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
node backend: a throw during suite registration is a named failure instead of a dropped-green run (#23). An exception in a describe() callback body (registration time, not inside a test) appears in node's TAP stream as a not ok suite entry - but node counts it under # suites rather than # fail and still exits 0, so the runner reported green while every test declared after the throw silently never registered. In one real migration (crank's eslint-plugin, PR bikeshaving/crank#376), nine such sites made a 126-test suite report "95 passed, 0 failed" on node. The TAP parser now processes each entry's full YAML block and counts suites with failureType: 'testCodeFailure' as failures, surfacing the actual thrown error; suites that are not ok merely because a child failed ('subtestsFailed') are excluded, so ordinary failures aren't double-counted through their parents. Failing tests also now carry their real error: text in the summary instead of a generic label.
Added
test.each / it.each / describe.each on the node backend (#23). bun:test and jest have .each; node:test does not - and it's the single most likely API to bite a suite moving over from bun test, precisely because the resulting TypeError sat inside describe() callbacks where the bug above swallowed it. Each table row registers one ordinary test, so snapshot name-tracking and registration counting see plain calls; row names support the positional printf tokens (%i/%s/%d/%f/%p/%j/%o/%#/%%). Array tables only (template-literal tables throw with a clear message), attached only when the runtime lacks .each, so a future node:test implementation wins.
Changed
libuild is ESM-only, stated as policy and enforced (#21). Source entrypoints are ES modules; .mjs/.cjs/.mts/.cts entrypoints are not supported; CommonJS exists solely as the main-field fallback artifact the build emits. A package that explicitly declares "type": "commonjs" is now refused by bothlibuild build and libuild test (all platforms) with a one-line fix: set "type": "module". Previously such packages half-worked - node/bun test runs passed incidentally while browser bundles died as an esbuild syntax error (esbuild classifies files in a commonjs-typed package as CJS from the package type even when they use import syntax, which puts the test dispatcher's required await init_...() inside a non-async wrapper). Partial support is still support, and worse, unreliable support; #21's namespace-plugin workaround was considered and rejected as quiet reinterpretation of an explicit declaration. Packages with notype field are unaffected: nothing was declared, and every tool involved classifies files by their own syntax.
Test bundles are plain .js again; the bundle directory declares itself ESM. 0.2.17's .mjs bundle extension is replaced by a {"type": "module"} package.json written into .libuild-test/ - one statement of the policy instead of per-file extension encoding. Bundles still load as ESM under node in consumers without a type of their own, and the generated entry is classified ESM by esbuild for the same reason.
Build errors exit with a one-line message instead of an unhandled-rejection stack dump.