From f4b8acd319f39c92e825dce4e8abf92e2668103e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 18 Feb 2022 09:07:29 +0100 Subject: [PATCH] [wasm] Ensure NodeJS for running tests isn't too old. --- src/mono/wasm/test-main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mono/wasm/test-main.js b/src/mono/wasm/test-main.js index f0c23298703206..0304dae01558bb 100644 --- a/src/mono/wasm/test-main.js +++ b/src/mono/wasm/test-main.js @@ -10,6 +10,10 @@ const is_browser = typeof window != "undefined"; const is_node = !is_browser && typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string'; +if (is_node && process.versions.node.split(".")[0] < 14) { + throw new Error(`NodeJS at '${process.execPath}' has too low version '${process.versions.node}'`); +} + // if the engine doesn't provide a console if (typeof (console) === "undefined") { globalThis.console = {