Skip to content

fix(tests): add missing smoke fixtures and SPDX headers#23

Open
igorjs wants to merge 6 commits into
mainfrom
feat/add-smoke-fixtures
Open

fix(tests): add missing smoke fixtures and SPDX headers#23
igorjs wants to merge 6 commits into
mainfrom
feat/add-smoke-fixtures

Conversation

@igorjs

@igorjs igorjs commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Why

The deno, bun, cf-workers, and browser CI integration jobs fail with module-not-found errors because the fixture files they invoke don't exist in the repo:

  • Deno and Bun jobs run tests/smoke-platform.mjs and tests/smoke-core.mjs
  • cf-workers job runs tests/workers/run.mjs
  • Browser job runs tests/browser/run.mjs

What changed

Four new fixture files, modeled on igorjs/pure-fx's fixtures and adapted to pure-test's actual public API:

  • tests/smoke-core.mjs: exports runSmokeCore(lib), exercises expect() matchers, spyFn, and the describe/it/runRegistered runner API. Self-executes on Node/Deno/Bun. Also the shared payload for the Workers and Browser harnesses.
  • tests/smoke-platform.mjs: standalone platform smoke test. Registers a suite with lifecycle hooks, it.skip, it.each, async tests, fake timers, spies, and nested describe. Runs via runRegistered() on Node/Deno/Bun.
  • tests/workers/run.mjs: reads smoke-core.mjs, strips the self-execute block, inlines it into a temporary Miniflare worker that imports dist/index.js, dispatches a fetch, and asserts all assertions pass.
  • tests/browser/run.mjs: spins up a local HTTP server, opens headless Chromium via Playwright, loads smoke-core.mjs as an ES module, and collects the result.

API adaptation decisions vs pure-fx:

  • smoke-core.mjs tests pure-test's own API (expect, spyFn, describe/it/runRegistered) instead of pure-fx's data library.
  • .rejects.toThrow() is NOT used: pure-test's toThrow requires a function, not an Error value. The .rejects sections use .toMatchObject({ message }) instead.
  • AssertionError.is() does not exist on the class; replaced with instanceof AssertionError and a message-length check.

SPDX headers: The CI's lint-and-test job checks every tracked .mjs and .ts file for SPDX-License-Identifier. All existing tracked files in bin/, scripts/, and tests/ were missing the header. Added // SPDX-License-Identifier: Apache-2.0 to all 16 affected files as a one-line prepend (shebang in bin/pure-test.mjs is preserved on line 1).

What was verified locally vs deferred to CI

Verified locally:

  • node tests/smoke-core.mjs: 72 passed, 0 failed
  • deno run --allow-all tests/smoke-core.mjs: 72 passed, 0 failed
  • bun tests/smoke-core.mjs: 72 passed, 0 failed
  • node tests/smoke-platform.mjs: 18 passed, 0 failed, 1 skipped
  • deno run --allow-all tests/smoke-platform.mjs: 18 passed, 0 failed, 1 skipped
  • bun tests/smoke-platform.mjs: 18 passed, 0 failed, 1 skipped
  • node tests/workers/run.mjs (miniflare): all 72 tests passed
  • node tests/browser/run.mjs (Playwright/Chromium): all 72 tests passed
  • node tests/self-test.mjs: 342 passed, 0 failed (main test suite unaffected)

Deferred to CI: matrix runs on deno-canary, bun-canary, Node 22/24, and the pinned CI environment.

@github-actions github-actions Bot added fix Bug fix size:l Large change (250-999 lines) test Test changes dco:failed Commits missing Signed-off-by cla:signed CLA signed by contributor labels Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Contributor Checks

❌ DCO Check Failed

The following commits are missing a Signed-off-by trailer: a1a1d53

Please amend your commits with git commit --amend --signoff and force-push.

✅ CLA Signed

Add the four fixture files the deno, bun, cf-workers, and browser CI
jobs depend on. Without these files the integration matrix fails with
module-not-found errors.

- tests/smoke-core.mjs: cross-runtime smoke test that exports
  runSmokeCore(lib), exercises expect(), spyFn, and the
  describe/it/runRegistered runner API. Self-executes on Node/Deno/Bun;
  also used as the payload for Workers and Browser harnesses.
- tests/smoke-platform.mjs: standalone platform smoke test covering
  lifecycle hooks, it.skip, it.each, async tests, fake timers, spies,
  and nested describe. Runs on Node/Deno/Bun via runRegistered().
- tests/workers/run.mjs: inlines smoke-core into a temporary Miniflare
  worker and asserts all 72 assertions pass in the Workers runtime.
- tests/browser/run.mjs: serves dist and test files over a local HTTP
  server, opens headless Chromium via Playwright, and collects results.

Also add SPDX-License-Identifier: Apache-2.0 headers to all tracked
.mjs and .ts files that were missing them. The CI lint-and-test job
checks every tracked file with git ls-files and exits 1 for any file
without the header.

Verified locally: smoke-core and smoke-platform pass on Node 26, Deno
2.4, and Bun 1.3. Workers runner passes via miniflare. Browser runner
passes via Playwright/Chromium.

Signed-off-by: Igor Santos <oss@mail.igorjs.io>
@igorjs
igorjs force-pushed the feat/add-smoke-fixtures branch from a1a1d53 to b8cde56 Compare July 1, 2026 15:52
@github-actions github-actions Bot added dco:passed All commits have Signed-off-by and removed dco:failed Commits missing Signed-off-by labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:signed CLA signed by contributor dco:passed All commits have Signed-off-by fix Bug fix size:l Large change (250-999 lines) test Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant