-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
makes
npm test
more robust with async-retry
and orchestrator.js
- Loading branch information
1 parent
6d4836a
commit ddb4b20
Showing
7 changed files
with
178 additions
and
9 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,27 @@ | ||
// comentario do commit | ||
// makes `npm test` more robust with `async-retry` and `orchestrator.js` | ||
|
||
import retry from "async-retry"; | ||
|
||
async function waitForAllServices() { | ||
await waitForWebServer(); | ||
|
||
async function waitForWebServer() { | ||
return retry(fetchStatusPage, { | ||
retries: 100, | ||
maxTimeout: 1000, | ||
}); | ||
|
||
async function fetchStatusPage() { | ||
const response = await fetch("http://localhost:3000/api/v1/status"); | ||
|
||
if (response.status !== 200) { | ||
throw Error(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
export default { | ||
waitForAllServices, | ||
}; |