Skip to content

Commit

Permalink
Add test use case for null
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo committed Apr 13, 2022
1 parent 81f9fc8 commit 4d6229e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ describe('formatPayload', () => {
expect(formatPayload(payload)).toEqual({});
});

test('throws if null is provided', () => {
const payload = {
foo: null,
baz: [null],
};

expect(() => formatPayload(payload)).toThrowErrorMatchingInlineSnapshot(
`"Unsupported type: object"`
);
});

describe('String to Date identification', () => {
test('appends `_date` to ISO string values', () => {
const payload = {
Expand Down

0 comments on commit 4d6229e

Please sign in to comment.