Skip to content

fix: replace tspl with native test context in test/examples.js#5300

Open
mcollina wants to merge 1 commit into
mainfrom
fix/examples-flaky-test
Open

fix: replace tspl with native test context in test/examples.js#5300
mcollina wants to merge 1 commit into
mainfrom
fix/examples-flaky-test

Conversation

@mcollina
Copy link
Copy Markdown
Member

@mcollina mcollina commented May 12, 2026

Fix flaky test/examples.js on Windows CI.

Changes

  • Migrate test/examples.js from tspl to native Node.js test runner features (t.plan, t.assert)
  • Fix missing after import in test/parser-issues.js (pre-existing lint error)

Why

The tspl proxy reassigns the test context variable (t = tspl(t, { plan: 7 })), which can cause issues with execution context resolution on Windows when combined with module-level after() calls for teardown hooks.

This matches the pattern already used in other tests in the codebase (e.g. test/mock-agent.js) and follows the ongoing migration from tspl to native test context.

Closes #5267

Migrate the request examples test from tspl to native Node.js test
runner features (t.plan, t.assert) to fix flakiness on Windows CI.

The tspl proxy reassigns the test context variable, which can cause
issues with execution context resolution on Windows when combined
with module-level after() calls for teardown hooks.

Also fix missing after() import in test/parser-issues.js.

Closes #5267
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.23%. Comparing base (13f6af6) to head (f22e2f0).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5300      +/-   ##
==========================================
- Coverage   93.26%   93.23%   -0.04%     
==========================================
  Files         110      110              
  Lines       36533    36575      +42     
==========================================
+ Hits        34071    34099      +28     
- Misses       2462     2476      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flaky] test\examples.js

2 participants