Repository navigation
fix(module): retain prepared ESM keys for equivalent paths #44482
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { expect, test } from "bun:test"; | ||
| import { bunEnv, bunExe, isWindows, tempDir } from "harness"; | ||
| import path from "node:path"; | ||
|
|
||
| for (const mode of ["plugin", "override"]) { | ||
| for (const spelling of isWindows ? ["dot", "forward"] : ["dot"]) { | ||
| test(`${mode} alias preserves the prepared ESM key with ${spelling} separators`, async () => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win Run the isolated subprocess cases concurrently. Each case has its own temporary directory and child process. Use 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| using dir = tempDir("resolved-module-key", {}); | ||
| await using child = Bun.spawn({ | ||
| cmd: [bunExe(), path.join(import.meta.dir, "plugin-resolved-key-fixture.cjs"), mode, spelling, String(dir)], | ||
| env: bunEnv, | ||
| stdout: "pipe", | ||
| stderr: "pipe", | ||
| }); | ||
| const [stdout, stderr, exitCode] = await Promise.all([child.stdout.text(), child.stderr.text(), child.exited]); | ||
| expect({ stdout, stderr, exitCode }).toEqual({ stdout: "ok\n", stderr: "", exitCode: 0 }); | ||
| }); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Group the related cases with
describe.each().The nested loops register the mode and spelling cases without a
describeblock. Usedescribe.each()to group the parameterized cases. As per coding guidelines: “Usedescribeblocks for grouping related tests” and “Usedescribe.each()for parameterized tests.”🤖 Prompt for AI Agents
Source: Coding guidelines