Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Fix Jest CI #1058

Merged
merged 1 commit into from
Nov 22, 2022
Merged

Fix Jest CI #1058

merged 1 commit into from
Nov 22, 2022

Conversation

dhmacs
Copy link
Contributor

@dhmacs dhmacs commented Nov 22, 2022

This has been extracted from #975

There are a few issues that break tests with updated dependencies, such as a version of the pnpm action that does not support pnpm v7 and a wrong command to install dependencies.

qa_req 0

@vercel
Copy link

vercel bot commented Nov 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-commerce ✅ Ready (Inspect) Visit Preview Nov 22, 2022 at 5:45PM (UTC)
react-commerce-prod ✅ Ready (Inspect) Visit Preview Nov 22, 2022 at 5:45PM (UTC)

Copy link
Contributor

@batbattur batbattur left a comment

Choose a reason for hiding this comment

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

CR 🚛

@dhmacs dhmacs merged commit 74c406d into main Nov 22, 2022
@dhmacs dhmacs deleted the fix-jest-ci branch November 22, 2022 17:57
@@ -19,7 +19,7 @@
"start:frontend": "cd frontend && pnpm run start",
"start": "cross-env FORCE_COLOR=1 npm-run-all -l -p start:*",
"strapi": "cd backend && pnpm run strapi",
"test": "echo \"Error: no test specified\" && exit 1",
Copy link
Member

Choose a reason for hiding this comment

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

Huh... I thought run test effectively runs the command specified by package.json['scripts']['test'], so this appears circular. I'm obviously wrong... So I guess -r means recursive but not including the current package?

Copy link
Contributor

Choose a reason for hiding this comment

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

So I guess -r means recursive but not including the current package?

In CI, we run pnpm test which runs for the pnpm run test -r.
I believe the pnpm run test -r includes the current package, from https://pnpm.io/cli/run#--recursive--r:

This runs an arbitrary command from each package's "scripts" object. If a package doesn't have the command, it is skipped. If none of the packages have the command, the command fails.

Copy link
Member

Choose a reason for hiding this comment

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

I believe the pnpm run test -r includes the current package

If that's the case, wouldn't that mean this setup is infinitely recursive?

i.e. pnpm run test -r runs the "scripts.test" command in each package... which is pnpm run test -r in the top level package.

I must be missing something.

Copy link
Contributor

@batbattur batbattur Nov 22, 2022

Choose a reason for hiding this comment

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

Whoops, I might have been wrong. The docs don't explicitly say it's excluded but it looks like the root dir is excluded. Found the relevant issues pnpm/pnpm#2769 and pnpm/pnpm#3647

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.

3 participants