Skip to content

Commit

Permalink
Merge branch 'koopjs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rgwozdz authored Aug 30, 2023
2 parents 2d1568c + 65be4a7 commit f8354c9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-jobs-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@koopjs/koop-core': patch
---

- ensure constructor options are optional
4 changes: 2 additions & 2 deletions packages/core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class Koop extends Events {
this.pluginRoutes = [];
this.outputs = [];

const { geoservicesDefaults } = options;
const { geoservicesDefaults } = this.config;

this.register(geoservices, {
logger: this.log,
authInfo: options?.authInfo || config.authInfo,
authInfo: this.config.authInfo,
defaults: geoservicesDefaults
});

Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ const providerFixtureRoutes = mockProviderDefinition.routes.reduce((acc, route)

describe('Index tests', function () {
describe('Koop instantiation', function () {
it('should instantiate Koop with config', function () {
it('should instantiate Koop with options', function () {
const koop = new Koop({ foo: 'bar', logLevel: 'error' });
koop.config.should.have.property('foo', 'bar');
});

it('should instantiate Koop without options', function () {
const koop = new Koop();
koop.config.should.be.empty();
});
});

describe('Provider registration', function () {
Expand Down

0 comments on commit f8354c9

Please sign in to comment.