ReviewOS

also looking at this

stacks/tuf-js

fix: restore HTTP interception between Jest environments

#2
Merged chris wants to merge codex/repo-mock-http-ci into main
2 files +10 -0
9 days ago

Jest reuses workers across test environments, while Node built-in HTTP modules survive environment disposal. Nock hooks from an earlier environment could then break the repo-mock endpoint tests with a synchronous TypeError. This caused recurring failures in the source main-branch CI matrix.

The shared native Jest setup now initializes Nock in each environment and restores its HTTP hooks before teardown, after aborting pending requests and clearing scopes. Endpoint assertions, runtime matrix, two-worker CI execution and coverage remain unchanged. No installed package files or dependency patches are used.

Validation: a fixed-order run of the existing fetcher and repo-mock endpoint tests fails 2/13 without lifecycle cleanup and passes 13/13 with it. Native source build, lint, formatting and repo-mock test types pass. Temporary diagnostics were removed. The local full suite was held because available disk fell below the 4 GB admission threshold; exact-head remote full CI is required before main publication. Independent Spec and Standards reviews are clean.

This repairs test-environment isolation. It does not publish the maintained client package or qualify Drone adoption; stacksjs/drone#108 tracks that work.

Exact-head CI 40121574701 passed all 16 jobs on its first attempt. Every one of the 15 OS/Node combinations passed all 348 tests in 29 suites. Conformance and smoke workflows also passed. Original CI logs are retained.

2 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.