From 81b2179588b665a3f30616081163177c5dcf6341 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 27 Mar 2023 12:08:37 -0400 Subject: [PATCH] Fix tests by matching equality instead of snapshots Signed-off-by: Sebastian Malton --- .../__tests__/extension-loader.test.ts | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/core/src/extensions/__tests__/extension-loader.test.ts b/packages/core/src/extensions/__tests__/extension-loader.test.ts index c0e679ca3c..9be0507f6d 100644 --- a/packages/core/src/extensions/__tests__/extension-loader.test.ts +++ b/packages/core/src/extensions/__tests__/extension-loader.test.ts @@ -113,38 +113,38 @@ describe("ExtensionLoader", () => { }); it("renderer updates extension after ipc broadcast", async () => { - expect(extensionLoader.userExtensions).toMatchInlineSnapshot(`Map {}`); + expect(extensionLoader.userExtensions).toEqual(new Map()); await extensionLoader.init(); await delay(10); // Assert the extensions after the extension broadcast event - expect(extensionLoader.userExtensions).toMatchInlineSnapshot(` - Map { - "manifest/path" => Object { - "absolutePath": "/test/1", - "id": "manifest/path", - "isBundled": false, - "isEnabled": true, - "manifest": Object { - "name": "TestExtension", - "version": "1.0.0", + expect(extensionLoader.userExtensions).toEqual( + new Map([ + ["manifest/path", { + absolutePath: "/test/1", + id: "manifest/path", + isBundled: false, + isEnabled: true, + manifest: { + name: "TestExtension", + version: "1.0.0", }, - "manifestPath": "manifest/path", - }, - "manifest/path3" => Object { - "absolutePath": "/test/3", - "id": "manifest/path3", - "isBundled": false, - "isEnabled": true, - "manifest": Object { - "name": "TestExtension3", - "version": "3.0.0", + manifestPath: "manifest/path", + }], + ["manifest/path3", { + absolutePath: "/test/3", + id: "manifest/path3", + isBundled: false, + isEnabled: true, + manifest: { + name: "TestExtension3", + version: "3.0.0", }, - "manifestPath": "manifest/path3", - }, - } - `); + manifestPath: "manifest/path3", + }], + ]), + ); }); it("updates ExtensionsStore after isEnabled is changed", async () => {