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

Update Jest to v29 #1271

Merged
merged 2 commits into from
Aug 17, 2023
Merged

Conversation

nicholas-l
Copy link
Contributor

@nicholas-l nicholas-l commented Aug 12, 2023

This updates to the latest Jest version.

Note: I haven't been able run tests (either master or this branch) locally as I believe it is due to Arm issues.

@nicholas-l nicholas-l marked this pull request as ready for review August 12, 2023 14:15
Copy link
Collaborator

@riccardoferretti riccardoferretti left a comment

Choose a reason for hiding this comment

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

Thanks for this.

I tested it locally and the only issue I have found is that if I run the tests from the root via yarn test, the command ends (successfully) before the tests are fully run. This doesn't happen with Jest 27.
This doesn't happen in CI as the --stream flag is being passed, and I tested locally that by passing the flag is issue is resolved too.
I have also verified that instead when running yarn test from within the foam-vscode package the behavior is correct (that is, the tests all run before the command returns)

Adding the --stream flag to the root package.json test script seems to fix the problem:

    "test": "yarn workspace foam-vscode test --stream",

@nicholas-l
Copy link
Contributor Author

What does that --stream flag do? I had assumed that it would be used in packages/foam-vscode/src/test/run-tests.ts but it doesn't seem to.

@riccardoferretti
Copy link
Collaborator

The issue seems to be in the way yarn delegates the command to the package.
I assume as much given that the issue only appears when running the command from the top level package, and not from within the package itself (the only difference between the two is the yarn delegation)

I can't find anything specific on the yarn documentation for the --stream flag though.

Keep in mind that we have a very old version of yarn (still v1), which should be updated to v3 (or removed altogether).

For the sake of this PR I am happy by simply adding --stream to the top-level script as mentioned in my previous comment

Without `--stream` in the workspace package, the command ends
successfully without correctly running the tests.
@riccardoferretti riccardoferretti merged commit 956d011 into foambubble:master Aug 17, 2023
3 checks passed
@riccardoferretti
Copy link
Collaborator

@allcontributors add @nicholas-l for code

@allcontributors
Copy link
Contributor

@riccardoferretti

I've put up a pull request to add @nicholas-l! 🎉

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.

2 participants