Skip to content

chore: run some test cases in bun in CI #6635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025
Merged

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented May 1, 2025

This PR starts running node compatible test cases in Bun in CI. This makes it easier to accept PRs like #6630 which says the change improves the bun compatibility.

In JSR pages, we already mark some of std packages compatible with Bun. So I believe this addition is reasonable

Copy link

codecov bot commented May 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.75%. Comparing base (bfd0096) to head (ac59472).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6635   +/-   ##
=======================================
  Coverage   94.75%   94.75%           
=======================================
  Files         584      584           
  Lines       46560    46560           
  Branches     6539     6539           
=======================================
  Hits        44116    44116           
  Misses       2401     2401           
  Partials       43       43           

☔ 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.

Comment on lines +3 to +13
"paths": {
"@std/assert": ["./assert/mod.ts"],
"@std/assert/greater-or-equal": ["./assert/greater_or_equal.ts"],
"@std/path": ["./path/mod.ts"],
"@std/internal/format": ["./internal/format.ts"],
"@std/internal/styles": ["./internal/styles.ts"],
"@std/internal/build-message": ["./internal/build_message.ts"],
"@std/internal/diff": ["./internal/diff.ts"],
"@std/internal/diff-str": ["./internal/diff_str.ts"],
"@std/semver": ["./semver/mod.ts"],
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

register function of node:module didn't seem working in Bun (which is used for resolving specifiers like @std/path in Node test runner), but instead Bun allows users to remap specifiers via compilerOptions.paths option. ref https://bun.sh/docs/runtime/modules#path-re-mapping

In the spirit of treating TypeScript as a first-class citizen, the Bun runtime will re-map import paths according to the compilerOptions.paths field in tsconfig.json. This is a major divergence from Node.js, which doesn't support any form of import path re-mapping.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pretty cool!

@kt3k kt3k merged commit d9df5c7 into denoland:main May 2, 2025
19 checks passed
@kt3k kt3k deleted the test-in-bun branch May 2, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants