Skip to content

Commit 9189536

Browse files
authored
refactor: use lowercase boolean in validation errors (#405)
1 parent d5b60a5 commit 9189536

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/object-schema/src/validation-strategy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class ValidationStrategy {
3030
*/
3131
static boolean(value) {
3232
if (typeof value !== "boolean") {
33-
throw new TypeError("Expected a Boolean.");
33+
throw new TypeError("Expected a boolean.");
3434
}
3535
}
3636

packages/object-schema/tests/validation-strategy.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@ describe("ValidationStrategy", () => {
2222
it("should throw an error when the value is null", () => {
2323
assert.throws(() => {
2424
ValidationStrategy.boolean(null);
25-
}, /Expected a Boolean/u);
25+
}, /Expected a boolean/u);
2626
});
2727

2828
it("should throw an error when the value is a string", () => {
2929
assert.throws(() => {
3030
ValidationStrategy.boolean("foo");
31-
}, /Expected a Boolean/u);
31+
}, /Expected a boolean/u);
3232
});
3333

3434
it("should throw an error when the value is a number", () => {
3535
assert.throws(() => {
3636
ValidationStrategy.boolean(123);
37-
}, /Expected a Boolean/u);
37+
}, /Expected a boolean/u);
3838
});
3939

4040
it("should throw an error when the value is an object", () => {
4141
assert.throws(() => {
4242
ValidationStrategy.boolean({});
43-
}, /Expected a Boolean/u);
43+
}, /Expected a boolean/u);
4444
});
4545
});
4646

0 commit comments

Comments
 (0)