Skip to content

[build] Fix tests by using tsc for all builds and proper ESM module a…#5939

Merged
vrubezhny merged 1 commit into
redhat-developer:mainfrom
vrubezhny:use-esbuild-for-tests
Jul 4, 2026
Merged

[build] Fix tests by using tsc for all builds and proper ESM module a…#5939
vrubezhny merged 1 commit into
redhat-developer:mainfrom
vrubezhny:use-esbuild-for-tests

Conversation

@vrubezhny

Copy link
Copy Markdown
Contributor

…liasing

  • Convert test/bootstrap.js to test/bootstrap.ts for automatic tsc transpilation
  • Load bootstrap via NODE_OPTIONS before extension activation to register ESM-to-CJS module aliases
  • Use absolute paths in bootstrap to correctly resolve aliased modules from any context
  • Unset ELECTRON_RUN_AS_NODE in test environment to prevent workspace file execution errors
  • Remove manual bootstrap require() calls from test index files
  • Alphabetize package.json devDependencies

This ensures tests run with tsc-built (unbundled) code rather than esbuild-bundled code, allowing Sinon stubs to work correctly.

Assisted-By: Claude Sonnet 4.5 noreply@anthropic.com

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.72%. Comparing base (da60441) to head (4f704c7).
⚠️ Report is 1859 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5939       +/-   ##
===========================================
+ Coverage   32.37%   47.72%   +15.35%     
===========================================
  Files          85      106       +21     
  Lines        6505     9841     +3336     
  Branches     1349     2229      +880     
===========================================
+ Hits         2106     4697     +2591     
- Misses       4399     5141      +742     
- Partials        0        3        +3     

☔ View full report in Codecov by Harness.
📢 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.

…liasing

- Convert test/bootstrap.js to test/bootstrap.ts for automatic tsc transpilation
- Load bootstrap via NODE_OPTIONS before extension activation to register ESM-to-CJS module aliases
- Use absolute paths in bootstrap to correctly resolve aliased modules from any context
- Unset ELECTRON_RUN_AS_NODE in test environment to prevent workspace file execution errors
- Remove manual bootstrap require() calls from test index files
- Alphabetize package.json devDependencies

This ensures tests run with tsc-built (unbundled) code rather than esbuild-bundled code,
allowing Sinon stubs to work correctly.

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
Assisted-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vrubezhny vrubezhny force-pushed the use-esbuild-for-tests branch from cc306f2 to 4f704c7 Compare July 4, 2026 17:19
@vrubezhny vrubezhny merged commit 85ddbcb into redhat-developer:main Jul 4, 2026
6 checks passed
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.

1 participant