Skip to content

Commit

Permalink
fix: remove LocalSchemaLoader
Browse files Browse the repository at this point in the history
Solves #2
  • Loading branch information
javier-sierra-sngular authored and jorgecasar committed Jan 18, 2024
1 parent b913ebb commit 85d684f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions lib/open-api-mocker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const { replaceCircularObject } = require('replace-circular-object');
const { Parser: OpenApiParser } = require('./openapi');
const { Parser: ServersParser } = require('./servers');
const { Parser: PathsParser } = require('./paths');
const LocalSchemaLoader = require('./schema-loaders/local-loader');
const OpenAPISchemaInvalid = require('./errors/openapi-schema-invalid-error');

const optionsBuilder = require('./utils/options-builder');
Expand All @@ -26,8 +25,6 @@ class OpenApiMocker {
if(!this.schemaLoader) {
if(this.options.schemaLoader)
this.schemaLoader = this.options.schemaLoader;
else if(typeof schema === 'string')
this.schemaLoader = new LocalSchemaLoader();
else
this.schemaLoader = new ExplicitSchemaLoader();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/open-api-mocker.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ describe('OpenAPI Mocker', () => {
await openApiMocker.validate();
await openApiMocker.mock();

sinon.assert.calledOnce(LocalSchemaLoader.prototype.load);
sinon.assert.notCalled(ExplicitSchemaLoader.prototype.load);
sinon.assert.calledOnce(ExplicitSchemaLoader.prototype.load);
sinon.assert.notCalled(LocalSchemaLoader.prototype.load);
});
});

Expand Down

0 comments on commit 85d684f

Please sign in to comment.