From 4d4e28f7a1fa26870abe270165d9f6591862f965 Mon Sep 17 00:00:00 2001 From: Bouillaguet Quentin Date: Wed, 13 Dec 2023 11:22:36 +0100 Subject: [PATCH] chore(test): fix bootstrap to follow ES semantics --- test/unit/bootstrap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/unit/bootstrap.js b/test/unit/bootstrap.js index 961cdf348a..131a2e4d2c 100644 --- a/test/unit/bootstrap.js +++ b/test/unit/bootstrap.js @@ -17,7 +17,10 @@ global.URL = function URL(url) { }; }; -global.Event = () => {}; +// https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-instanceofoperator +// ES standard requires that left-hand side shall have a prototype method, this +// is not the case for lambdas. +global.Event = function () {}; global.requestAnimationFrame = () => {}; global.fetch = fetch; global.fetch.Promise = Promise; @@ -184,7 +187,7 @@ global.document.emitEvent = (event, params) => { global.document.documentElement = global.document.createElement(); global.document.body = new DOMElement(); -global.XRRigidTransform = () => {}; +global.XRRigidTransform = class {}; class Path2D { moveTo() {}