Skip to content

Commit

Permalink
style: please linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiphe committed Sep 26, 2017
1 parent 949c561 commit 9c6d312
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/getValue.js
Expand Up @@ -16,11 +16,11 @@ module.exports = function getValue(aValue, defaultValue, key) {
}

if (type(value) !== type(defaultValue)) {
throw new Error(
`config value for "${key}"` +
` must be of type ${type(defaultValue)}` +
` but is ${type(value)}`
);
throw new Error([
`config value for "${key}"`,
`must be of type ${type(defaultValue)}`,
`but is ${type(value)}`,
].join(' '));
}

return value;
Expand Down
10 changes: 4 additions & 6 deletions test/UberconfigSpec.js
Expand Up @@ -53,9 +53,8 @@ describe('Uberconfig', () => {
it('throws when configuration types are incompatible', () => {
const config = new Uberconfig({ foo: false });

expect(
() => config.get('foo', 'false')
).toThrow(errorMatching('must be of type string but is boolean'));
expect(() => config.get('foo', 'false'))
.toThrow(errorMatching('must be of type string but is boolean'));
});

it(
Expand All @@ -66,9 +65,8 @@ describe('Uberconfig', () => {

config.get('foo', 2);

expect(
() => config.get('foo', 3)
).toThrow(errorMatching('conflicting default values for uberconfig'));
expect(() => config.get('foo', 3))
.toThrow(errorMatching('conflicting default values for uberconfig'));
}
);

Expand Down

0 comments on commit 9c6d312

Please sign in to comment.