Skip to content

Commit

Permalink
fix reporting schema tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed May 18, 2021
1 parent d3617ed commit 1dfe1b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/reporting/server/config/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe('Reporting Config Schema', () => {
// kibanaServer
const throwValidationErr = () => ConfigSchema.validate({ kibanaServer: { hostname: '0' } });
expect(throwValidationErr).toThrowError(
`[kibanaServer.hostname]: must not be "0" for the headless browser to correctly resolve the host`
`[kibanaServer.hostname]: value must be a valid hostname (see RFC 1123).`
);
});
});
11 changes: 1 addition & 10 deletions x-pack/plugins/reporting/server/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ import { ByteSizeValue, schema, TypeOf } from '@kbn/config-schema';
import moment from 'moment';

const KibanaServerSchema = schema.object({
hostname: schema.maybe(
schema.string({
validate(value) {
if (value === '0') {
return 'must not be "0" for the headless browser to correctly resolve the host';
}
},
hostname: true,
})
),
hostname: schema.maybe(schema.string({ hostname: true })),
port: schema.maybe(schema.number()),
protocol: schema.maybe(
schema.string({
Expand Down

0 comments on commit 1dfe1b0

Please sign in to comment.