Skip to content

Commit

Permalink
Adding test to ensure modifier gets called in correct order
Browse files Browse the repository at this point in the history
  • Loading branch information
fishcharlie committed Apr 18, 2020
1 parent 1a8931c commit 13845d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/Document.js
Expand Up @@ -1689,6 +1689,11 @@ describe("Document", () => {
"schema": {"id": Number, "name": {"type": String, "set": (val) => val === "" ? undefined : val}},
"input": [{"id": 1, "name": ""}, {"type": "toDynamo", "modifiers": ["set"]}],
"output": {"id": 1, "name": undefined}
},
{
"schema": {"id": Number, "name": {"type": String, "required": true, "set": (val) => val === "" ? undefined : val}},
"input": [{"id": 1, "name": ""}, {"type": "toDynamo", "modifiers": ["set"], "required": true}],
"error": new Error.ValidationError("name is a required property but has no value when trying to save document")
}
];

Expand Down

0 comments on commit 13845d1

Please sign in to comment.