From 9265e9072d512ab1188c1d6347bc46c287775a93 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sat, 10 Jun 2023 11:43:41 +0300 Subject: [PATCH] Add test for #183 --- test/test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test.ts b/test/test.ts index d686439..11f7f9c 100644 --- a/test/test.ts +++ b/test/test.ts @@ -24,6 +24,8 @@ const {window} = new JSDOM(); const {document} = window; const createDomElement = (element: string) => document.createElement(element); +const structuredClone = globalThis.structuredClone ?? (x => x); + type Test = { assert: (...args: any[]) => void | never; fixtures: unknown[]; @@ -487,6 +489,9 @@ const types = new Map([ {x: 1}, Object.create(null), new Object(), // eslint-disable-line no-new-object + structuredClone({x: 1}), + structuredClone(Object.create(null)), + structuredClone(new Object()), // eslint-disable-line no-new-object ], typename: 'Object', typeDescription: AssertionTypeDescription.plainObject,