mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
parent
3ae2b81acc
commit
bcddc14012
2 changed files with 10 additions and 3 deletions
|
@ -124,7 +124,10 @@ export class Config {
|
|||
});
|
||||
|
||||
if (results.error) {
|
||||
throw results.error;
|
||||
const error = new Error(results.error.message);
|
||||
error.name = results.error.name;
|
||||
error.stack = results.error.stack;
|
||||
throw error;
|
||||
}
|
||||
|
||||
this[vals] = results.value;
|
||||
|
|
|
@ -174,7 +174,7 @@ describe('lib/config/config', function () {
|
|||
});
|
||||
|
||||
it('should thow an exception when setting a value with the wrong type', function (done) {
|
||||
expect.assertions(2);
|
||||
expect.assertions(4);
|
||||
|
||||
const run = function () {
|
||||
config.set('test.enable', 'something');
|
||||
|
@ -184,7 +184,11 @@ describe('lib/config/config', function () {
|
|||
run();
|
||||
} catch (err) {
|
||||
expect(err).toHaveProperty('name', 'ValidationError');
|
||||
expect(err.details[0].message).toBe('"enable" must be a boolean');
|
||||
expect(err).toHaveProperty('message',
|
||||
'child \"test\" fails because [child \"enable\" fails because [\"enable\" must be a boolean]]'
|
||||
);
|
||||
expect(err).not.toHaveProperty('details');
|
||||
expect(err).not.toHaveProperty('_object');
|
||||
}
|
||||
|
||||
done();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue