From 69a4825f5a7adb96ccef17a63f088df13e5dfb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Wed, 2 Dec 2020 22:02:57 +0100 Subject: [PATCH] Updated devtools --- serializer.test.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/serializer.test.ts b/serializer.test.ts index 42a2a6b..f5947e0 100644 --- a/serializer.test.ts +++ b/serializer.test.ts @@ -1,8 +1,8 @@ import { - it, expect, - patch, -} from "https://code.thunderk.net/typescript/devtools/raw/1.0.0/testing.ts"; + it, + mock, +} from "https://code.thunderk.net/typescript/devtools/raw/1.2.2/testing.ts"; import { Serializer } from "./serializer.ts"; class TestSerializerObj1 { @@ -162,13 +162,12 @@ it("calls specific postUnserialize", () => { }); it("handles missing classes", () => { - const mock_error = patch(console, "error", () => {}); - let serializer = new Serializer(TEST_NS); - mock_error.exec(() => { + mock(console, "error", undefined, (mock_error) => { + let serializer = new Serializer(TEST_NS); let data = serializer.serialize({ obj: new TestSerializerObj4() }); let loaded = serializer.unserialize(data); expect(loaded).toEqual({ obj: { a: 0 } }); - expect(mock_error.fn).toHaveBeenCalledWith( + expect(mock_error).toHaveBeenCalledWith( "Can't find class", "TestSerializerObj4", );