This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Francisco Javier Ribó Labrador <elribonazo@gmail.com>
- Loading branch information
1 parent
90ffcf8
commit 1bb3e0c
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Array to store the status of each package's coverage command | ||
statuses=() | ||
|
||
# Run coverage command in each package | ||
# Run the coverage command for the package | ||
output=$(npm run coverage 2>&1) | ||
|
||
# Check if the output contains the specific text you want to check for | ||
if [[ "$output" =~ "does not meet global threshold" ]]; then | ||
echo "Coverage command failed in package" | ||
statuses+=("failed") | ||
else | ||
statuses+=("success") | ||
fi | ||
# Check if any package failed | ||
if [[ "${statuses[*]}" =~ "failed" ]]; then | ||
echo "Coverage failed in one or more packages." | ||
exit 1 | ||
else | ||
echo "Coverage passed in all packages." | ||
exit 0 | ||
fi |
This file contains 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
This file contains 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