From fa59a0d3a4ab4012ee5f4cf0dfa72157ab460bba Mon Sep 17 00:00:00 2001 From: Ev Haus Date: Sat, 2 Mar 2024 23:28:41 -0800 Subject: [PATCH] Fix broken Jasmine CI runs --- benchmarks/jasmine/spec/helpers/happydom.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/benchmarks/jasmine/spec/helpers/happydom.ts b/benchmarks/jasmine/spec/helpers/happydom.ts index ecfc539..477f48a 100644 --- a/benchmarks/jasmine/spec/helpers/happydom.ts +++ b/benchmarks/jasmine/spec/helpers/happydom.ts @@ -7,10 +7,17 @@ global.window = window; // Register global window extensions [ 'document', + // NOTE: This is need for running tests on GitHub Actions CI, but causes + // failure on local builds due to this error: + // > Cannot set property navigator of # which has only a getter + 'navigator', 'Element', 'getComputedStyle', 'HTMLElement', 'SVGElement' ].forEach((key) => { - global[key] = global.window[key]; + try { + global[key] = global.window[key]; + } catch (e) { + } }); \ No newline at end of file