All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
testandtest.*now accept an optionaloptionsobject as the second argument —test(name, options, fn)— matchingnode:testcall signature. The only supported option istimeout(number, in milliseconds). Every valid x-test call is a validnode:testcall (#99).- All public API functions (
assert,assert.deepEqual,assert.throws,assert.rejects,load,suite,suite.*,test,test.*) now validate their arguments strictly: wrong argument count, wrong types, or invalid option keys throw immediately with a descriptive error pointing at the call site. assert.throws(fn, error, message?)andassert.rejects(fn, error, message?)for asserting that a function throws or an async function rejects. Theerrorargument is aRegExptested againstString(thrown)(consistent withnode:assert) (#99).assert.deepEqual(actual, expected, message?)for strict deep-equality comparison of primitives, plain objects, and arrays. Unsupported types (Map, Set, Date, RegExp, class instances, functions) throw rather than compare, so support can be broadened later without breaking callers (#99).- Adds TypeScript support for top-level exports from
x-test. Previously, it the integration with TypeScript applications was not smooth (#68, #75). - Adds “?x-test-name-pattern” query param to enable filtering of tests based on the given pattern name. This is done internally so it will work in both a browser and a CLI output (#58).
- Assertion failures now show only user code in the stack trace. Internal
x-test frames are stripped via
Error.captureStackTrace(Chromium / V8), and callbacks are deferred to a fresh micro task so that BroadcastChannel machinery does not appear below user frames (#106). - Renamed
ittotestanddescribetosuiteacross the entire public API and all internal concepts.import { test, suite, assert, load }is now the canonical import. - Renamed
test(href)load function toload(href). Conceptually, when you call this function you “load a new frame with this href” (#99). - Typed
assertas a proper TypeScript assertion function (asserts ok) so that type narrowing works automatically after assertions (#74). - Updated dependencies, including major bumps to ESLint (9.x → 10.x) and
TypeScript (5.x → 6.x). Added
globalsas an explicit dev dependency. - The “@netflix/x-test-cli” is now packaged separately and is imported here like any other dev dependency.
- Communications happen through a
BroadcastChannelinstead oftop. This is better since it doesn’t use globals. Instead, a more targetedx-testchannel is utilized for client <<>> root <<>> suite communications (#51).
- Asynchronous registration via
waitForis removed — synchronous imports (includingimport ... with { type: 'json' }) handle fixture data, andtestcallbacks may still be async for per-test work (#80). - The
coverage()API, thex-test-run-coverageURL parameter, and all associated TAP output have been removed. Coverage analysis is now the exclusive responsibility of@netflix/x-test-cli(#99). - The
x-test-no-reporterURL parameter has been removed. The reporter UI is now always rendered (#99). - The public
BroadcastChanneleventsx-test-client-ping,x-test-root-pong,x-test-root-coverage-request,x-test-client-coverage-result, andx-test-root-endhave been removed. The CLI now observes a run solely by consuming TAP output from the console (#99).
- TAP version pragma now emits
TAP version 14(lower-casev) to match the TAP specification text (#88). - Suites no longer bail with “Timed out loading …” partway through an
otherwise successful run. When the child’s
readybeat its iframe load event, the iframe was removed before load could dispatch and the load-phase timer later settled a stale race (#83). - Iframes pointed at bad URLs (404, 500, SPA fallbacks, unreachable
hosts) now fail cleanly with a clear error instead of silently
passing as
1..0 okor hanging (#82). - Multiple
<script type="module">tags in one HTML file now all register tests into the same suite. Previously only the first script’s registrations survived; the rest were silently dropped (#81).
- NPM token lives in a GH environment for publish action (more secure).
- Don’t fail strict integrator CSP rules. Previously, we inlined some <style>
tags which would fail for a rule set like
default-src 'self';. To ensure we don’t reintroduce — strict CSP headers are now added to all test documents.
- Changed “root” detection to something other than the “id” attribute.
- Initial interface for
1.xis locked down.