From 4d6229e2536da5e66351df9f38704ab7e7ee3e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Wed, 13 Apr 2022 11:14:35 +0200 Subject: [PATCH] Add test use case for `null` --- .../src/shippers/fullstory/format_payload.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/elastic-analytics/src/shippers/fullstory/format_payload.test.ts b/packages/elastic-analytics/src/shippers/fullstory/format_payload.test.ts index 4751e6db490e1..6f9ad05bc9da7 100644 --- a/packages/elastic-analytics/src/shippers/fullstory/format_payload.test.ts +++ b/packages/elastic-analytics/src/shippers/fullstory/format_payload.test.ts @@ -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 = {