diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index d6cc38b7c..0d7517750 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -22,7 +22,7 @@ const closureCompiler = require('google-closure-compiler').gulp(); const argv = require('yargs').argv; const {rimraf} = require('rimraf'); -const {BUILD_DIR, DEPS_FILE, RELEASE_DIR, TEST_DEPS_FILE, TSC_OUTPUT_DIR, TYPINGS_BUILD_DIR} = require('./config'); +const {BUILD_DIR, DEPS_FILE, RELEASE_DIR, TSC_OUTPUT_DIR, TYPINGS_BUILD_DIR} = require('./config'); const {getPackageJson} = require('./helper_tasks'); const {posixPath, quote} = require('../helpers'); @@ -305,36 +305,17 @@ function buildJavaScript(done) { * This task updates DEPS_FILE (deps.js), used by the debug module * loader (via bootstrap.js) when loading Blockly in uncompiled mode. * - * Also updates TEST_DEPS_FILE (deps.mocha.js), used by the mocha test - * suite. - * * Prerequisite: buildJavaScript. */ function buildDeps() { const roots = [ path.join(TSC_OUTPUT_DIR, 'closure', 'goog', 'base.js'), TSC_OUTPUT_DIR, - 'tests/mocha', ]; /** Maximum buffer size, in bytes for child process stdout/stderr. */ const MAX_BUFFER_SIZE = 10 * 1024 * 1024; - /** - * Filter a string to extract lines containing (or not containing) the - * specified target string. - * - * @param {string} text Text to filter. - * @param {string} target String to search for. - * @param {boolean?} exclude If true, extract only non-matching lines. - * @returns {string} Filtered text. - */ - function filter(text, target, exclude) { - return text.split('\n') - .filter((line) => Boolean(line.match(target)) !== Boolean(exclude)) - .join('\n'); - } - /** * Log unexpected diagnostics, after removing expected warnings. * @@ -374,9 +355,7 @@ error message above, try running: } else { log(stderr); // Anything not about mocha goes in DEPS_FILE. - fs.writeFileSync(DEPS_FILE, filter(stdout, 'tests/mocha', true)); - // Anything about mocha does in TEST_DEPS_FILE. - fs.writeFileSync(TEST_DEPS_FILE, filter(stdout, 'tests/mocha')); + fs.writeFileSync(DEPS_FILE, stdout); resolve(); } }); @@ -691,10 +670,8 @@ async function buildShims() { // ESM, but fortunately we don't attempt to import or require this // file from node.js - we only feed it to Closure Compiler, which // uses the type information in deps.js rather than package.json. - await fsPromises.writeFile( - path.join(BUILD_DIR, 'package.json'), - '{"type": "module"}' - ); + const TMP_PACKAGE_JSON = path.join(BUILD_DIR, 'package.json'); + await fsPromises.writeFile(TMP_PACKAGE_JSON, '{"type": "module"}'); // Import each entrypoint module, enumerate its exports, and write // a shim to load the chunk either by importing the entrypoint @@ -723,6 +700,8 @@ ${Object.keys(exports).map((name) => ` ${name},`).join('\n')} ); `); })); + + await fsPromises.rm(TMP_PACKAGE_JSON); } diff --git a/scripts/gulpfiles/config.js b/scripts/gulpfiles/config.js index 674432dde..02a0499c4 100644 --- a/scripts/gulpfiles/config.js +++ b/scripts/gulpfiles/config.js @@ -28,9 +28,6 @@ exports.BUILD_DIR = 'build'; // Dependencies file (used by bootstrap.js in uncompiled mode): exports.DEPS_FILE = path.join(exports.BUILD_DIR, 'deps.js'); -// Mocha test dependencies file (used by tests/mocha/index.html): -exports.TEST_DEPS_FILE = path.join(exports.BUILD_DIR, 'deps.mocha.js'); - // Directory to write typings output to. exports.TYPINGS_BUILD_DIR = path.join(exports.BUILD_DIR, 'declarations'); diff --git a/tests/mocha/astnode_test.js b/tests/mocha/astnode_test.js index a91119261..a9f0de0d3 100644 --- a/tests/mocha/astnode_test.js +++ b/tests/mocha/astnode_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.astNode'); - import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; import { sharedTestSetup, diff --git a/tests/mocha/block_json_test.js b/tests/mocha/block_json_test.js index cd4337ef0..e89c68e7c 100644 --- a/tests/mocha/block_json_test.js +++ b/tests/mocha/block_json_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.blockJson'); - import {Align} from '../../build/src/core/inputs/align.js'; import { sharedTestSetup, diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index 7308ce607..2cf50fea0 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.blocks'); - import {ConnectionType} from '../../build/src/core/connection_type.js'; import {createDeprecationWarningStub} from './test_helpers/warnings.js'; import {createRenderedBlock} from './test_helpers/block_definitions.js'; diff --git a/tests/mocha/blocks/lists_test.js b/tests/mocha/blocks/lists_test.js index e4875225a..07510513b 100644 --- a/tests/mocha/blocks/lists_test.js +++ b/tests/mocha/blocks/lists_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.lists'); - import {runSerializationTestSuite} from '../test_helpers/serialization.js'; import { sharedTestSetup, diff --git a/tests/mocha/blocks/logic_ternary_test.js b/tests/mocha/blocks/logic_ternary_test.js index 9a1e3be48..2afa51f7a 100644 --- a/tests/mocha/blocks/logic_ternary_test.js +++ b/tests/mocha/blocks/logic_ternary_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.logicTernary'); - import * as eventUtils from '../../../build/src/core/events/utils.js'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; import { diff --git a/tests/mocha/blocks/procedures_test.js b/tests/mocha/blocks/procedures_test.js index 5163e715d..6173179cd 100644 --- a/tests/mocha/blocks/procedures_test.js +++ b/tests/mocha/blocks/procedures_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.procedures'); - import * as Blockly from '../../../build/src/core/blockly.js'; import { assertCallBlockStructure, diff --git a/tests/mocha/blocks/variables_test.js b/tests/mocha/blocks/variables_test.js index 75afa9d56..caee68aec 100644 --- a/tests/mocha/blocks/variables_test.js +++ b/tests/mocha/blocks/variables_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.variables'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/clipboard_test.js b/tests/mocha/clipboard_test.js index f6cf10a25..f134b1d77 100644 --- a/tests/mocha/clipboard_test.js +++ b/tests/mocha/clipboard_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.clipboard'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/comment_deserialization_test.js b/tests/mocha/comment_deserialization_test.js index c7398bbe0..494c584e7 100644 --- a/tests/mocha/comment_deserialization_test.js +++ b/tests/mocha/comment_deserialization_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.commentDeserialization'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/comment_test.js b/tests/mocha/comment_test.js index fa3190d95..6f19aa7f0 100644 --- a/tests/mocha/comment_test.js +++ b/tests/mocha/comment_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.comments'); - import {assertEventFired} from './test_helpers/events.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; import { diff --git a/tests/mocha/connection_checker_test.js b/tests/mocha/connection_checker_test.js index 908adf8fb..09797d6a7 100644 --- a/tests/mocha/connection_checker_test.js +++ b/tests/mocha/connection_checker_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.connectionChecker'); - import {ConnectionType} from '../../build/src/core/connection_type.js'; import { sharedTestSetup, diff --git a/tests/mocha/connection_db_test.js b/tests/mocha/connection_db_test.js index 7f3219fa2..9cf579f1b 100644 --- a/tests/mocha/connection_db_test.js +++ b/tests/mocha/connection_db_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.connectionDb'); - import {ConnectionType} from '../../build/src/core/connection_type.js'; import { sharedTestSetup, diff --git a/tests/mocha/connection_test.js b/tests/mocha/connection_test.js index 0646458b8..afba4948c 100644 --- a/tests/mocha/connection_test.js +++ b/tests/mocha/connection_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.connection'); - import { createGenUidStubWithReturns, sharedTestSetup, diff --git a/tests/mocha/contextmenu_items_test.js b/tests/mocha/contextmenu_items_test.js index a9d1a5009..4596513c6 100644 --- a/tests/mocha/contextmenu_items_test.js +++ b/tests/mocha/contextmenu_items_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.contextMenuItem'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/cursor_test.js b/tests/mocha/cursor_test.js index c435a1e5e..c7b3a76af 100644 --- a/tests/mocha/cursor_test.js +++ b/tests/mocha/cursor_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.cursor'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/dropdowndiv_test.js b/tests/mocha/dropdowndiv_test.js index a2e08e4d1..22066dda4 100644 --- a/tests/mocha/dropdowndiv_test.js +++ b/tests/mocha/dropdowndiv_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.dropdown'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_block_change_test.js b/tests/mocha/event_block_change_test.js index 398238527..4f4728cc3 100644 --- a/tests/mocha/event_block_change_test.js +++ b/tests/mocha/event_block_change_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventBlockChange'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_block_create_test.js b/tests/mocha/event_block_create_test.js index 1469df4bb..b17b277e7 100644 --- a/tests/mocha/event_block_create_test.js +++ b/tests/mocha/event_block_create_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventBlockCreate'); - import {assertEventFired} from './test_helpers/events.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; import { diff --git a/tests/mocha/event_block_delete_test.js b/tests/mocha/event_block_delete_test.js index 806ecad4b..1aa70c4d1 100644 --- a/tests/mocha/event_block_delete_test.js +++ b/tests/mocha/event_block_delete_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventBlockDelete'); - import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_block_drag_test.js b/tests/mocha/event_block_drag_test.js index 176666f6f..8a5399c8b 100644 --- a/tests/mocha/event_block_drag_test.js +++ b/tests/mocha/event_block_drag_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventBlockDrag'); - import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_block_field_intermediate_change_test.js b/tests/mocha/event_block_field_intermediate_change_test.js index 6990eda19..e8a71effb 100644 --- a/tests/mocha/event_block_field_intermediate_change_test.js +++ b/tests/mocha/event_block_field_intermediate_change_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventBlockFieldIntermediateChange'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_block_move_test.js b/tests/mocha/event_block_move_test.js index b647ee173..2b4102de6 100644 --- a/tests/mocha/event_block_move_test.js +++ b/tests/mocha/event_block_move_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventBlockMove'); - import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_bubble_open_test.js b/tests/mocha/event_bubble_open_test.js index 910030b9d..54e48aa9c 100644 --- a/tests/mocha/event_bubble_open_test.js +++ b/tests/mocha/event_bubble_open_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventBubbleOpen'); - import {defineMutatorBlocks} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_click_test.js b/tests/mocha/event_click_test.js index 47ee96edf..ec998b62d 100644 --- a/tests/mocha/event_click_test.js +++ b/tests/mocha/event_click_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventClick'); - import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_comment_change_test.js b/tests/mocha/event_comment_change_test.js index fd9827ac6..7c68d0858 100644 --- a/tests/mocha/event_comment_change_test.js +++ b/tests/mocha/event_comment_change_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventCommentChange'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_comment_create_test.js b/tests/mocha/event_comment_create_test.js index 31ebd2e94..d140eff85 100644 --- a/tests/mocha/event_comment_create_test.js +++ b/tests/mocha/event_comment_create_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventCommentCreate'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_comment_delete_test.js b/tests/mocha/event_comment_delete_test.js index ae9c016b6..fc4b7701f 100644 --- a/tests/mocha/event_comment_delete_test.js +++ b/tests/mocha/event_comment_delete_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventCommentDelete'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_comment_move_test.js b/tests/mocha/event_comment_move_test.js index d192053f0..a0b0b5eab 100644 --- a/tests/mocha/event_comment_move_test.js +++ b/tests/mocha/event_comment_move_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventCommentMove'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_marker_move_test.js b/tests/mocha/event_marker_move_test.js index df8fa544a..26238dc43 100644 --- a/tests/mocha/event_marker_move_test.js +++ b/tests/mocha/event_marker_move_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventMarkerMove'); - import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_selected_test.js b/tests/mocha/event_selected_test.js index 83a64a566..3c69889f2 100644 --- a/tests/mocha/event_selected_test.js +++ b/tests/mocha/event_selected_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventSelected'); - import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index 1fd7addb1..e59cb4911 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.event'); - import * as Blockly from '../../build/src/core/blockly.js'; import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; import { diff --git a/tests/mocha/event_theme_change_test.js b/tests/mocha/event_theme_change_test.js index 1e3fa2c88..155e373a3 100644 --- a/tests/mocha/event_theme_change_test.js +++ b/tests/mocha/event_theme_change_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventThemeChange'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_toolbox_item_select_test.js b/tests/mocha/event_toolbox_item_select_test.js index 32b085781..82f8e4863 100644 --- a/tests/mocha/event_toolbox_item_select_test.js +++ b/tests/mocha/event_toolbox_item_select_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventToolboxItemSelect'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_trashcan_open_test.js b/tests/mocha/event_trashcan_open_test.js index c85dbd3d1..84c2abd9c 100644 --- a/tests/mocha/event_trashcan_open_test.js +++ b/tests/mocha/event_trashcan_open_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventTrashcanOpen'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_var_create_test.js b/tests/mocha/event_var_create_test.js index 433d5d4ae..003cd11b5 100644 --- a/tests/mocha/event_var_create_test.js +++ b/tests/mocha/event_var_create_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventVarCreate'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_var_delete_test.js b/tests/mocha/event_var_delete_test.js index 2619a8db0..7bad8eb7b 100644 --- a/tests/mocha/event_var_delete_test.js +++ b/tests/mocha/event_var_delete_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventVarDelete'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_var_rename_test.js b/tests/mocha/event_var_rename_test.js index 8f9d63d88..0c8fb80cd 100644 --- a/tests/mocha/event_var_rename_test.js +++ b/tests/mocha/event_var_rename_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventVarRename'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/event_viewport_test.js b/tests/mocha/event_viewport_test.js index 275d6854b..7913e7bf5 100644 --- a/tests/mocha/event_viewport_test.js +++ b/tests/mocha/event_viewport_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.eventViewportChange'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/extensions_test.js b/tests/mocha/extensions_test.js index f918b935c..8eb37e75d 100644 --- a/tests/mocha/extensions_test.js +++ b/tests/mocha/extensions_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.extensions'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_angle_test.js b/tests/mocha/field_angle_test.js index 6ab130842..62afd8d27 100644 --- a/tests/mocha/field_angle_test.js +++ b/tests/mocha/field_angle_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldAngle'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_checkbox_test.js b/tests/mocha/field_checkbox_test.js index 5e971cd0c..4f9503d9c 100644 --- a/tests/mocha/field_checkbox_test.js +++ b/tests/mocha/field_checkbox_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldCheckbox'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_colour_test.js b/tests/mocha/field_colour_test.js index 97aba7d95..fcc5041bd 100644 --- a/tests/mocha/field_colour_test.js +++ b/tests/mocha/field_colour_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldColour'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_dropdown_test.js b/tests/mocha/field_dropdown_test.js index 26820230e..616211287 100644 --- a/tests/mocha/field_dropdown_test.js +++ b/tests/mocha/field_dropdown_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldDropdown'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_image_test.js b/tests/mocha/field_image_test.js index 6911d8679..ec8ad2227 100644 --- a/tests/mocha/field_image_test.js +++ b/tests/mocha/field_image_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldImage'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_label_serializable_test.js b/tests/mocha/field_label_serializable_test.js index 61c6d72c7..37052f046 100644 --- a/tests/mocha/field_label_serializable_test.js +++ b/tests/mocha/field_label_serializable_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldLabelSerialization'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_label_test.js b/tests/mocha/field_label_test.js index a378334a2..368e7fd3c 100644 --- a/tests/mocha/field_label_test.js +++ b/tests/mocha/field_label_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldLabel'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_multilineinput_test.js b/tests/mocha/field_multilineinput_test.js index de2a8189f..abdf68237 100644 --- a/tests/mocha/field_multilineinput_test.js +++ b/tests/mocha/field_multilineinput_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldMultiline'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_number_test.js b/tests/mocha/field_number_test.js index 3b03a5135..4dcc930da 100644 --- a/tests/mocha/field_number_test.js +++ b/tests/mocha/field_number_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldNumber'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_registry_test.js b/tests/mocha/field_registry_test.js index 41c320c57..f8e4bb9b4 100644 --- a/tests/mocha/field_registry_test.js +++ b/tests/mocha/field_registry_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldRegistry'); - import * as Blockly from '../../build/src/core/blockly.js'; import {createDeprecationWarningStub} from './test_helpers/warnings.js'; import { diff --git a/tests/mocha/field_test.js b/tests/mocha/field_test.js index c8e73e29d..7265a1bb4 100644 --- a/tests/mocha/field_test.js +++ b/tests/mocha/field_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldTest'); - import * as Blockly from '../../build/src/core/blockly.js'; import { addBlockTypeToCleanup, diff --git a/tests/mocha/field_textinput_test.js b/tests/mocha/field_textinput_test.js index 27d950789..5a8a82479 100644 --- a/tests/mocha/field_textinput_test.js +++ b/tests/mocha/field_textinput_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldTextInput'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/field_variable_test.js b/tests/mocha/field_variable_test.js index 011c44dbc..0815303c6 100644 --- a/tests/mocha/field_variable_test.js +++ b/tests/mocha/field_variable_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.fieldVariable'); - import * as Blockly from '../../build/src/core/blockly.js'; import { assertFieldValue, diff --git a/tests/mocha/flyout_test.js b/tests/mocha/flyout_test.js index 3c38d2552..f2fe79e38 100644 --- a/tests/mocha/flyout_test.js +++ b/tests/mocha/flyout_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.flyout'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/generator_test.js b/tests/mocha/generator_test.js index 7d1415874..eea386432 100644 --- a/tests/mocha/generator_test.js +++ b/tests/mocha/generator_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.generator'); - import * as Blockly from '../../build/src/core/blockly.js'; import {DartGenerator} from '../../build/src/generators/dart/dart_generator.js'; import {JavascriptGenerator} from '../../build/src/generators/javascript/javascript_generator.js'; diff --git a/tests/mocha/gesture_test.js b/tests/mocha/gesture_test.js index 01885427b..0572fed5b 100644 --- a/tests/mocha/gesture_test.js +++ b/tests/mocha/gesture_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.gesture'); - import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; import {defineBasicBlockWithField} from './test_helpers/block_definitions.js'; import {dispatchPointerEvent} from './test_helpers/user_input.js'; diff --git a/tests/mocha/icon_test.js b/tests/mocha/icon_test.js index 4c3d20492..4ff27997f 100644 --- a/tests/mocha/icon_test.js +++ b/tests/mocha/icon_test.js @@ -4,8 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -goog.declareModuleId('Blockly.test.icon'); - import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/index.html b/tests/mocha/index.html index de11f6a94..f94eabfa1 100644 --- a/tests/mocha/index.html +++ b/tests/mocha/index.html @@ -29,106 +29,123 @@ ui: 'tdd', failZero: true, }); - - var BLOCKLY_BOOTSTRAP_OPTIONS = { - loadCompressed: false, - depsFiles: ['build/deps.js', 'build/deps.mocha.js'], - requires: [ - // Test modules. - 'Blockly.test.astNode', - 'Blockly.test.blockJson', - 'Blockly.test.blocks', - 'Blockly.test.clipboard', - 'Blockly.test.comments', - 'Blockly.test.commentDeserialization', - 'Blockly.test.connectionChecker', - 'Blockly.test.connectionDb', - 'Blockly.test.connection', - 'Blockly.test.contextMenuItem', - 'Blockly.test.cursor', - 'Blockly.test.dropdown', - 'Blockly.test.event', - 'Blockly.test.eventBlockChange', - 'Blockly.test.eventBlockCreate', - 'Blockly.test.eventBlockDelete', - 'Blockly.test.eventBlockDrag', - 'Blockly.test.eventBlockFieldIntermediateChange', - 'Blockly.test.eventBlockMove', - 'Blockly.test.eventBubbleOpen', - 'Blockly.test.eventClick', - 'Blockly.test.eventCommentChange', - 'Blockly.test.eventCommentCreate', - 'Blockly.test.eventCommentDelete', - 'Blockly.test.eventCommentMove', - 'Blockly.test.eventMarkerMove', - 'Blockly.test.eventSelected', - 'Blockly.test.eventThemeChange', - 'Blockly.test.eventToolboxItemSelect', - 'Blockly.test.eventTrashcanOpen', - 'Blockly.test.eventVarCreate', - 'Blockly.test.eventVarDelete', - 'Blockly.test.eventVarRename', - 'Blockly.test.eventViewportChange', - 'Blockly.test.extensions', - 'Blockly.test.fieldAngle', - 'Blockly.test.fieldCheckbox', - 'Blockly.test.fieldColour', - 'Blockly.test.fieldDropdown', - 'Blockly.test.fieldImage', - 'Blockly.test.fieldLabelSerialization', - 'Blockly.test.fieldLabel', - 'Blockly.test.fieldMultiline', - 'Blockly.test.fieldNumber', - 'Blockly.test.fieldRegistry', - 'Blockly.test.fieldTest', - 'Blockly.test.fieldTextInput', - 'Blockly.test.fieldVariable', - 'Blockly.test.flyout', - 'Blockly.test.generator', - 'Blockly.test.gesture', - 'Blockly.test.icon', - 'Blockly.test.input', - 'Blockly.test.insertionMarker', - 'Blockly.test.insertionMarkerManager', - 'Blockly.test.jsoDeserialization', - 'Blockly.test.jsoSerialization', - 'Blockly.test.json', - 'Blockly.test.keydown', - 'Blockly.test.lists', - 'Blockly.test.logicTernary', - 'Blockly.test.metrics', - 'Blockly.test.mutator', - 'Blockly.test.names', - 'Blockly.test.procedureMap', - 'Blockly.test.procedures', - 'Blockly.test.registry', - 'Blockly.test.renderManagement', - 'Blockly.test.serialization', - 'Blockly.test.shortcutRegistry', - 'Blockly.test.touch', - 'Blockly.test.theme', - 'Blockly.test.toolbox', - 'Blockly.test.tooltip', - 'Blockly.test.trashcan', - 'Blockly.test.utils', - 'Blockly.test.variableMap', - 'Blockly.test.variableModel', - 'Blockly.test.variables', - 'Blockly.test.widgetDiv', - 'Blockly.test.workspaceComment', - 'Blockly.test.workspaceSvg', - 'Blockly.test.workspace', - 'Blockly.test.xml', - 'Blockly.test.zoomControls', - ], - scripts: [ - 'build/msg/en.js', - 'tests/playgrounds/screenshot.js', - 'node_modules/@blockly/dev-tools/dist/index.js', - ], - }; - + +
@@ -202,21 +219,5 @@ style="display: none">