From 9651fcd8cd2e90571b88ad804ebe978021feb11f Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Wed, 19 Jul 2023 09:56:08 +0200 Subject: [PATCH] test(refactor): use 'toEqual' instead of 'toStrictEqual' for Responses More context in https://github.com/octokit/core.js/issues/588 --- test/scenarios/errors.test.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/test/scenarios/errors.test.ts b/test/scenarios/errors.test.ts index 2ea53f6f..66c2010e 100644 --- a/test/scenarios/errors.test.ts +++ b/test/scenarios/errors.test.ts @@ -24,16 +24,13 @@ describe("api.github.com", () => { expect(error.message).toEqual( `Validation Failed: {"resource":"Label","code":"invalid","field":"color"}`, ); - // To-Do: Figure out why the objects are not strictly equal - expect(JSON.stringify(error.response.data.errors)).toStrictEqual( - JSON.stringify([ - { - resource: "Label", - code: "invalid", - field: "color", - }, - ]), - ); + expect(error.response.data.errors).toEqual([ + { + resource: "Label", + code: "invalid", + field: "color", + }, + ]); expect(error.response.data.documentation_url).toMatch( new RegExp("rest/reference/issues#create-a-label"), );