-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add some tests to run on Node.js 18 and later
- Loading branch information
Showing
4 changed files
with
375 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
|
||
# Start the server. | ||
npm run start & | ||
# Give server some time to start completely. | ||
sleep 3 | ||
SERVER_PID=$(pgrep node) | ||
echo "Server process id is $SERVER_PID." | ||
|
||
# Run actual tests. | ||
node --test | ||
EXIT_CODE=$? | ||
|
||
# Stop / kill server process. | ||
kill $SERVER_PID | ||
if [ $? -ne 0 ] | ||
then | ||
kill -9 $SERVER_PID | ||
fi | ||
|
||
sleep 1 | ||
|
||
if [ $EXIT_CODE -eq 0 ] | ||
then | ||
echo Tests were successful. | ||
exit 0 | ||
else | ||
echo Tests have failed. | ||
exit 1 | ||
fi |
Oops, something went wrong.