Skip to content
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

[windows] bunshell stacktrace test is failing #11305

Open
nektro opened this issue May 23, 2024 · 0 comments
Open

[windows] bunshell stacktrace test is failing #11305

nektro opened this issue May 23, 2024 · 0 comments
Assignees
Labels
bug Something isn't working windows An issue that only occurs on Windows

Comments

@nektro
Copy link
Contributor

nektro commented May 23, 2024

in test/js/bun/shell/bunshell.test.ts

  test("stacktrace", async () => {
    // const folder = TestBuilder.tmpdir();
    const code = /* ts */ `import { $ } from 'bun'

    $.throws(true)

    async function someFunction() {
      await $\`somecommandthatdoesnotexist\`
    }

    await someFunction()
    `;

    const [_, lineNr] = code
      .split("\n")
      .map((l, i) => [l, i + 1] as const)
      .find(([line, _]) => line.includes("somecommandthatdoesnotexist"))!;

    if (lineNr === undefined) throw new Error("uh oh");

    await TestBuilder.command`BUN_DEBUG_QUIET_LOGS=1 ${BUN} -e ${code} 2>&1`
      .exitCode(1)
      .stdout(s => expect(s).toInclude(`[eval]:${lineNr}`))
      .run();
  });
Expected to include: "[eval]:6"
Received: "bun: command not found: somecommandthatdoesnotexist\n1 | import { $ } from 'bun'\n2 | \n3 |     $.throws(true)\n4 | \n5 |     async function someFunction() {\n                   ^\nShellError: Failed with exit code 1\n info: {\n  \"exitCode\": 1,\n  \"stderr\": \"bun: command not found: somecommandthatdoesnotexist\\n\",\n  \"stdout\": \"\"\n}\n\n      at new ShellError (:12:16)\n      at new ShellPromise (:70:16)\n      at BunShell (:194:35)\n      at C:\\bun\\test\\[eval]:5:12\n      at asyncFunctionResume (:1:11)\n      at someFunction (C:\\bun\\test\\[eval]:3:18)\n      at module code (C:\\bun\\test\\[eval]:9:11)\n      at evaluate (native:1:1)\n      at asyncFunctionResume (:1:11)\n\nBun v1.1.10-debug (Windows x64)\n"

      at C:\bun\test\js\bun\shell\test_builder.ts:223:11
      at asyncFunctionResume (:1:21)
      at doChecks (C:\bun\test\js\bun\shell\test_builder.ts:217:20)
      at C:\bun\test\js\bun\shell\test_builder.ts:268:15
      at asyncFunctionResume (:1:21)
      at promiseReactionJobWithoutPromise (:1:21)
✗ deno_task > stacktrace [58.29ms]
@nektro nektro added bug Something isn't working windows An issue that only occurs on Windows labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows An issue that only occurs on Windows
Projects
None yet
Development

No branches or pull requests

2 participants