Skip to content

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

Closed
igorjs wants to merge 7 commits into
mainfrom
feat/add-smoke-fixtures
Closed

igorjs wants to merge 7 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
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 14 days if no further activity occurs. If this PR is still in progress, please comment or push new commits to keep it open.

@github-actions github-actions Bot added the stale No activity for extended period label Sep 7, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stale for 14 days with no activity.

@github-actions github-actions Bot closed this Sep 21, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

This PR has been locked because it has been closed for more than 30 days with no further activity. Please open a new PR if you'd like to continue this work.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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) stale No activity for extended period test Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant