Skip to content

Commit

Permalink
fix: check for empty schemaPaths flag
Browse files Browse the repository at this point in the history
  • Loading branch information
javier-sierra-sngular authored and jorgecasar committed Jan 12, 2024
1 parent 4bc8329 commit f73dc29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/user-flow-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ async function init({ origin, schemaPaths, ports } = { schemaPaths: [], ports: [
}

const schemasFilePaths = schemas.map((s) => s.filePath);
const schemaPathsAreAvailable = schemaPaths?.every((path) => schemasFilePaths.includes(path));
const schemaPathsAreAvailable =
Boolean(schemaPaths.length) && schemaPaths.every((path) => schemasFilePaths.includes(path));

const schemasToMock = schemaPathsAreAvailable
? schemaPaths
Expand Down
2 changes: 2 additions & 0 deletions test/unit/services/user-flow-steps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ describe('unit: user-flow-steps', () => {
inquirerInputStub.resolves(localSchema.port);
const config = await userFlowSteps.init({
origin: localSchema.path,
port: [],
schemaPaths: [],
});
expect(findOasFromDirStub).to.have.been.calledWith(localSchema.path);
expect(inquirerCheckboxStub).to.have.been.calledWith(match.object);
Expand Down

0 comments on commit f73dc29

Please # to comment.