Update checked-in dependencies
This commit is contained in:
parent
79817eb679
commit
9c3b394d7f
402 changed files with 12598 additions and 2912 deletions
48
node_modules/@humanwhocodes/object-schema/tests/object-schema.js
generated
vendored
48
node_modules/@humanwhocodes/object-schema/tests/object-schema.js
generated
vendored
|
|
@ -110,6 +110,54 @@ describe("ObjectSchema", () => {
|
|||
|
||||
});
|
||||
|
||||
it("should throw an error when merge() throws an error with a readonly message", () => {
|
||||
let schema = new ObjectSchema({
|
||||
foo: {
|
||||
merge() {
|
||||
throw {
|
||||
get message() {
|
||||
return "Boom!";
|
||||
}
|
||||
};
|
||||
},
|
||||
validate() {}
|
||||
}
|
||||
});
|
||||
|
||||
assert.throws(() => {
|
||||
schema.merge({ foo: true }, { foo: true });
|
||||
}, /Key "foo": Boom!/);
|
||||
|
||||
});
|
||||
|
||||
it("should throw an error with custom properties when merge() throws an error with custom properties", () => {
|
||||
let schema = new ObjectSchema({
|
||||
foo: {
|
||||
merge() {
|
||||
throw {
|
||||
get message() {
|
||||
return "Boom!";
|
||||
},
|
||||
booya: true
|
||||
};
|
||||
},
|
||||
validate() {}
|
||||
}
|
||||
});
|
||||
|
||||
let errorThrown = false;
|
||||
|
||||
try {
|
||||
schema.merge({ foo: true }, { foo: true });
|
||||
} catch (ex) {
|
||||
errorThrown = true;
|
||||
assert.isTrue(ex.booya);
|
||||
}
|
||||
|
||||
assert.isTrue(errorThrown);
|
||||
|
||||
});
|
||||
|
||||
it("should call the merge() strategy for one key when called", () => {
|
||||
|
||||
schema = new ObjectSchema({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue