Skip to content

Commit

Permalink
feat(services): add multiple mock servers functionality
Browse files Browse the repository at this point in the history
Refs #8
  • Loading branch information
MHCYR committed Oct 20, 2023
1 parent 4695e60 commit 92d55d5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/services/user-flow-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,24 @@ async function getSchemas(origin) {
* @async
* @function startMockServer
* @param {number} port - The port to start the mock server
* @param {string} schema - The schema to mock
* @param {string[]} schemas - An array of schemas
* @returns {Promise<void>}
*/
async function startMockServer(port, schema) {
const openApiMocker = new OpenApiMocker({
port: port,
schema: schema,
watch: true,
});
async function startMockServer(port, schemas) {
let currentPort = port;
for (const schema of schemas) {
const openApiMocker = new OpenApiMocker({
port: currentPort,
schema: schema,
watch: true,
});

await openApiMocker.validate();
await openApiMocker.validate();

await openApiMocker.mock();
await openApiMocker.mock();
currentPort++;
}
}

/**
* get initial values from user
* @async
Expand Down

0 comments on commit 92d55d5

Please sign in to comment.