From 5ba773db22485d08d99e2ee961fe8e21bc5f2b42 Mon Sep 17 00:00:00 2001 From: gusthoff Date: Sat, 2 Nov 2024 23:05:13 +0100 Subject: [PATCH] Widget: fix for __dirname in module --- frontend/tests/ts/widget.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/tests/ts/widget.spec.ts b/frontend/tests/ts/widget.spec.ts index 16472308e..4f6d25c7b 100644 --- a/frontend/tests/ts/widget.spec.ts +++ b/frontend/tests/ts/widget.spec.ts @@ -23,6 +23,12 @@ import {getElemsByTag, getElemById, getElemsByClass} global.WebSocket = WebSocket; +import { fileURLToPath } from 'url'; +import { dirname } from 'path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + /** * Helper function to fill DOM from a file *