From f3861563b78f1c8b17451d9ebb8fc213d238018b Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 26 May 2022 18:51:15 +0100 Subject: [PATCH] fix(tests): Throw error if attempting to bootstrap in node.js --- tests/bootstrap.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/bootstrap.js b/tests/bootstrap.js index 797a449d9..8f6977687 100644 --- a/tests/bootstrap.js +++ b/tests/bootstrap.js @@ -54,6 +54,15 @@ Object.assign(options, window.BLOCKLY_BOOTSTRAP_OPTIONS); } + /* eslint-disable-next-line no-undef */ + if (typeof module === 'object' && typeof module.exports === 'object') { + // Running in node.js. Maybe we wish to support this. + // blockly_uncompiled formerly did, though it appears that the + // code had not been working for some time (at least since PR + // #5718 back in December 2021. For now just throw an error. + throw new Error('Bootstrapping in node.js not implemented.'); + } + if (!options.loadCompiled) { // We can load Blockly in uncompiled mode. Note that this section // needs to parse in IE11 (mostly ES5.1, but allowing e.g. const),