From 4dc2f2f2677f31bec26081ea022b03e819a0b471 Mon Sep 17 00:00:00 2001 From: Chris Raible Date: Thu, 29 Aug 2024 23:35:46 -0700 Subject: [PATCH] Fixed admin-x-settings tests failing because postData was not JSON --- apps/admin-x-framework/src/test/acceptance.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/admin-x-framework/src/test/acceptance.ts b/apps/admin-x-framework/src/test/acceptance.ts index 4bf8a38ee9..dcf740ce3f 100644 --- a/apps/admin-x-framework/src/test/acceptance.ts +++ b/apps/admin-x-framework/src/test/acceptance.ts @@ -186,7 +186,12 @@ export async function mockApi }); } - const requestBody = JSON.parse(route.request().postData() || 'null'); + let requestBody = null; + try { + requestBody = JSON.parse(route.request().postData() || 'null'); + } catch { + requestBody = route.request().postData(); + } lastApiRequests[matchingMock.name] = { body: requestBody,