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

test: use esbuild to transpile files #5581

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

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented Jul 15, 2023

What's the problem this PR addresses?

We use esbuild to build and run Yarn from sources but not for our test files.

Follow-up to #5180

How did you fix it?

Use esbuild to transpile files in our testing setup.

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

arcanis pushed a commit that referenced this pull request Jul 18, 2023
**What's the problem this PR addresses?**

While working on #5581 I noticed
that we're not normalizing the registry passed to the `npmHttpUtils`
methods.
There are tests that are supposed to catch this but the mock wasn't
reset before each test so they didn't.

**How did you fix it?**

Normalize the registry and update the tests to use `wrapNetworkRequest`.

**Checklist**
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
arcanis pushed a commit that referenced this pull request Jul 18, 2023
**What's the problem this PR addresses?**

One of our tests mocks `got` to validate that it is passed the correct
URL which doesn't work when transpiled by esbuild.
We have a test that checks that the URL is correct using
`wrapNetworkRequest` and various integration tests that should cover it.

Extracted from #5581

**How did you fix it?**

Removed the test that required mocking `got`.

**Checklist**
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
@merceyz merceyz force-pushed the merceyz/chore/esbuild-jest branch from bde16f0 to 780564b Compare July 18, 2023 22:37
@merceyz merceyz changed the title chore: use esbuild for jest test: use esbuild to transpile files Sep 30, 2023
@merceyz merceyz marked this pull request as ready for review September 30, 2023 16:52
@merceyz merceyz requested a review from arcanis October 6, 2023 13:53
@merceyz merceyz enabled auto-merge October 6, 2023 13:54
merceyz added a commit that referenced this pull request Oct 21, 2023
**What's the problem this PR addresses?**

One of our tests mocks `got` to validate that it is passed the correct
URL which doesn't work when transpiled by esbuild.
We have a test that checks that the URL is correct using
`wrapNetworkRequest` and various integration tests that should cover it.

Extracted from #5581

**How did you fix it?**

Removed the test that required mocking `got`.

**Checklist**
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.

(cherry picked from commit 0dc8b6a)
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

1 participant