fix(tests): Throw error if attempting to bootstrap in node.js

This commit is contained in:
Christopher Allen
2022-05-26 18:51:15 +01:00
parent de776f5629
commit f3861563b7

9
tests/bootstrap.js vendored
View File

@@ -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),