Skip to content

Commit

Permalink
[fix] use validateKey to validate partial
Browse files Browse the repository at this point in the history
  • Loading branch information
toddself committed May 24, 2019
1 parent b9fb137 commit c2489d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
9 changes: 1 addition & 8 deletions src/core/server/http/http_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,8 @@ test('creates and sets up second http server', async () => {
const serverSetup = await service.setup();
await service.start();

const configService2 = createConfigService({
host: 'example.org',
port: 2345,
});

const config2 = configService2.atPath<HttpConfig>('server');
const cfg = await config2.pipe(first()).toPromise();
const cfg = { port: 2345 };
await serverSetup.createNewServer(cfg);

expect(mockHttpServer.mock.instances.length).toBe(2);

try {
Expand Down
3 changes: 1 addition & 2 deletions src/core/server/http/http_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ export class HttpService implements CoreService<HttpServiceSetup, HttpServiceSta
}

for (let [key, val] of Object.entries(cfg)) {
const schema = config.schema.reach(key);
schema.validate(val);
config.schema.validateKey(key, val);
}

const baseConfig = await this.config$.pipe(first()).toPromise();
Expand Down

0 comments on commit c2489d2

Please sign in to comment.