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

chore: opt jest codebase #14366

Merged
merged 10 commits into from Aug 21, 2023
Merged

chore: opt jest codebase #14366

merged 10 commits into from Aug 21, 2023

Conversation

eryue0220
Copy link
Contributor

Summary

This pr is optimize code base. Including jest-runtime, jest-changed-files and jest-core and so on.

Test plan

@netlify
Copy link

netlify bot commented Jul 26, 2023

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 34d589c
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/64df924e87d2670008cda366
😎 Deploy Preview https://deploy-preview-14366--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

packages/jest-util/src/notEmpty.ts Outdated Show resolved Hide resolved

export default function invariant(
condition: unknown,
message?: string,
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to make the message required. Also it would be nice to append "This is a bug in Jest...", like here:

`Module cache already has entry ${cacheKey}. This is a bug in Jest, please report it!`,

'Module cache does not contain module. This is a bug in Jest, please open up an issue',

invariant() is used in places there value is defined, but TypeScript cannot see that. So a failure is definitely a bug, that is why it makes sense to append "This is a bug in Jest..."

By the way, it could be good default message (instead of making the message required).

@mrazauskas
Copy link
Contributor

Sorry, I was wrong. Apparently invariant() is also used to validated custom transformers. CI got broken, these messages are correct in current tests.

@eryue0220
Copy link
Contributor Author

@mrazauskas I've try some methods to fix CI, and it did not work. Now I need your help. Is there any suggestions or methods to fix the broken CI. The informations is above:

monitors only root paths for git
EBUSY: resource busy or locked, rmdir '\\?\C:\Users\RUNNER~1\AppData\Local\Temp\jest-changed-files-test-dir'

    at rmSync (e2e/Utils.ts:105:8)
    at Object.<anonymous> (e2e/__tests__/jestChangedFiles.test.ts:61:25)

and

gets hg SCM roots and dedupes them
EBUSY: resource busy or locked, rmdir '\\?\C:\Users\RUNNER~1\AppData\Local\Temp\jest-changed-files-test-dir'

    at rmSync (e2e/Utils.ts:105:8)
    at Object.<anonymous> (e2e/__tests__/jestChangedFiles.test.ts:61:25)

more details in link.

Thanks any more.

@mrazauskas
Copy link
Contributor

This is flaky test. Just ignore it. Not related with your changes.

@eryue0220
Copy link
Contributor Author

Can this pr be merged, if no other problems ? cc @SimenB @mrazauskas

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

thanks!

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants