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

Fix sloppily written test #10976

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix sloppily written test #10976

wants to merge 1 commit into from

Conversation

Jarred-Sumner
Copy link
Collaborator

What does this PR do?

Fix sloppily written test (cc @nektro):

  • It did not set the current working directory, so it installed "stripe" into the bun repository instead of the temporary test folder
  • It did not check the exit code of bun install
  • It only happened to work due to auto-install picking a globally-installed version of stripe.
  • String.raw usage is unnecessary
  • It unnecessarily used the node test harness instead of bun:test

This also:

  • Make running bun install in /package.json or test/package.json from inside a test fail so that we don't run bun install in the wrong directory again in a test

How did you verify your code works?

Ran the stripe test locally

Copy link

@Jarred-Sumner, your commit has failing tests :(

💪 3 failing tests Darwin AARCH64

💻 1 failing tests Darwin x64 baseline

💻 4 failing tests Darwin x64

🐧💪 1 failing tests Linux AARCH64

🪟💻 11 failing tests Windows x64 baseline

🪟💻 8 failing tests Windows x64

View logs

Comment on lines -7 to +6
it.skipIf(!process.env.TEST_INFO_STRIPE)("should be able to query a charge", async () => {
it.skipIf(!isBunCI && !process.env.TEST_INFO_STRIPE)("should be able to query a charge", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

what issues did you have running it locally?

let err = await new Response(stderr).text();
expect(err).not.toContain("panic:");
expect(err).not.toContain("error:");
expect(err).not.toContain("warn:");
let out = await new Response(stdout).text();
expect(await exited).toBe(0);
Copy link
Contributor

@nektro nektro May 10, 2024

Choose a reason for hiding this comment

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

it was done the other way so that you can see what the error was when it failed and nothing when it succeeds

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.

None yet

2 participants