-
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.
- Loading branch information
Adán Toscano López
committed
Oct 26, 2023
1 parent
bb8d4d7
commit c9377b5
Showing
7 changed files
with
168 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import OpenApiMocker from '@os3/open-api-mocker'; | ||
|
||
/** | ||
* @typedef {import('./user-flow-steps.js').Schema} Schema | ||
*/ | ||
|
||
/** | ||
* Start the mock server | ||
* @async | ||
* @function startMockServer | ||
* @param {Schema[]} schemas - An array of schemas | ||
* @returns {Promise<void>} | ||
*/ | ||
async function startMockServer(schemas) { | ||
for (const schema of schemas) { | ||
const openApiMocker = new OpenApiMocker({ | ||
port: schema.port, | ||
schema: schema.path, | ||
watch: true, | ||
}); | ||
|
||
await openApiMocker.validate(); | ||
await openApiMocker.mock(); | ||
// Separate each server with a empty line | ||
console.log(); | ||
} | ||
} | ||
|
||
export default startMockServer; |
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