Enable Support for Running Jest Tests From Workspace Version#7867
Open
awanlin wants to merge 3 commits intobackstage:mainfrom
Open
Enable Support for Running Jest Tests From Workspace Version#7867awanlin wants to merge 3 commits intobackstage:mainfrom
awanlin wants to merge 3 commits intobackstage:mainfrom
Conversation
Signed-off-by: Andre Wanlin <awanlin@spotify.com>
Signed-off-by: Andre Wanlin <awanlin@spotify.com>
43 tasks
vinzscam
reviewed
Mar 2, 2026
Comment on lines
+169
to
+176
| run: | | ||
| if node -e "const p = require('./package.json'); process.exit(p.devDependencies?.jest ? 0 : 1)"; then | ||
| echo "Using Jest 30" | ||
| ./node_modules/.bin/backstage-cli repo test --coverage --maxWorkers=3 | ||
| else | ||
| echo "Using Jest 29 from the Backstage CLI" | ||
| yarn backstage-cli repo test --coverage --maxWorkers=3 | ||
| fi |
Member
There was a problem hiding this comment.
can't we do this instead? 🤔
Suggested change
| run: | | |
| if node -e "const p = require('./package.json'); process.exit(p.devDependencies?.jest ? 0 : 1)"; then | |
| echo "Using Jest 30" | |
| ./node_modules/.bin/backstage-cli repo test --coverage --maxWorkers=3 | |
| else | |
| echo "Using Jest 29 from the Backstage CLI" | |
| yarn backstage-cli repo test --coverage --maxWorkers=3 | |
| fi | |
| run: ./node_modules/.bin/backstage-cli repo test --coverage --maxWorkers=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I just made a Pull Request!
This PR enables support for running Jest test from the Workspace. The reason this is needed is that we have and old version of the
@backstage/clipackage in the root of this repo that still contains Jest. If we were to bump it or remove it all the workspaces would break. This approach allows us to migrate workspace by workspace.community-plugins/package.json
Line 21 in 00555dc
✔️ Checklist
Signed-off-byline in the message. (more info)