From 793b18a4b500ad497136380c893960eae159fbc0 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 27 Jul 2026 14:30:04 -0700 Subject: [PATCH 01/13] test: Fix imports --- packages/blockly/package.json | 4 ++++ packages/blockly/tests/mocha/aria_test.js | 4 ++-- packages/blockly/tests/mocha/block_json_test.js | 4 ++-- packages/blockly/tests/mocha/block_test.js | 16 ++++++++-------- .../blockly/tests/mocha/blocks/lists_test.js | 4 ++-- .../tests/mocha/blocks/logic_ternary_test.js | 4 ++-- .../blockly/tests/mocha/blocks/loops_test.js | 4 ++-- .../tests/mocha/blocks/procedures_test.js | 4 ++-- .../blockly/tests/mocha/blocks/variables_test.js | 4 ++-- packages/blockly/tests/mocha/clipboard_test.js | 2 +- .../tests/mocha/comment_deserialization_test.js | 2 +- packages/blockly/tests/mocha/comment_test.js | 4 ++-- .../blockly/tests/mocha/comment_view_test.js | 2 +- .../tests/mocha/connection_checker_test.js | 4 ++-- .../blockly/tests/mocha/connection_db_test.js | 6 +++--- packages/blockly/tests/mocha/connection_test.js | 2 +- .../tests/mocha/contextmenu_items_test.js | 2 +- packages/blockly/tests/mocha/contextmenu_test.js | 6 +++--- packages/blockly/tests/mocha/dialog_test.js | 2 +- packages/blockly/tests/mocha/dropdowndiv_test.js | 9 ++++++--- .../tests/mocha/event_block_change_test.js | 2 +- .../tests/mocha/event_block_create_test.js | 4 ++-- .../tests/mocha/event_block_delete_test.js | 2 +- .../blockly/tests/mocha/event_block_drag_test.js | 2 +- ...event_block_field_intermediate_change_test.js | 2 +- .../blockly/tests/mocha/event_block_move_test.js | 2 +- .../tests/mocha/event_bubble_open_test.js | 2 +- packages/blockly/tests/mocha/event_click_test.js | 2 +- .../tests/mocha/event_comment_change_test.js | 2 +- .../tests/mocha/event_comment_collapse_test.js | 2 +- .../tests/mocha/event_comment_create_test.js | 2 +- .../tests/mocha/event_comment_delete_test.js | 2 +- .../tests/mocha/event_comment_drag_test.js | 2 +- .../tests/mocha/event_comment_move_test.js | 2 +- .../tests/mocha/event_comment_resize_test.js | 2 +- .../blockly/tests/mocha/event_selected_test.js | 2 +- packages/blockly/tests/mocha/event_test.js | 6 +++--- .../tests/mocha/event_theme_change_test.js | 2 +- .../mocha/event_toolbox_item_select_test.js | 2 +- .../tests/mocha/event_trashcan_open_test.js | 2 +- .../blockly/tests/mocha/event_var_create_test.js | 2 +- .../blockly/tests/mocha/event_var_delete_test.js | 2 +- .../blockly/tests/mocha/event_var_rename_test.js | 2 +- .../tests/mocha/event_var_type_change_test.js | 2 +- .../blockly/tests/mocha/event_viewport_test.js | 2 +- packages/blockly/tests/mocha/extensions_test.js | 2 +- .../blockly/tests/mocha/field_checkbox_test.js | 4 ++-- .../blockly/tests/mocha/field_dropdown_test.js | 4 ++-- packages/blockly/tests/mocha/field_image_test.js | 4 ++-- .../tests/mocha/field_label_serializable_test.js | 4 ++-- packages/blockly/tests/mocha/field_label_test.js | 4 ++-- .../blockly/tests/mocha/field_number_test.js | 4 ++-- .../blockly/tests/mocha/field_registry_test.js | 4 ++-- packages/blockly/tests/mocha/field_test.js | 4 ++-- .../blockly/tests/mocha/field_textinput_test.js | 4 ++-- .../blockly/tests/mocha/field_variable_test.js | 4 ++-- packages/blockly/tests/mocha/flyout_test.js | 2 +- .../blockly/tests/mocha/focus_manager_test.js | 7 ++----- .../tests/mocha/focusable_tree_traverser_test.js | 6 +++--- packages/blockly/tests/mocha/generator_test.js | 14 +++++++------- packages/blockly/tests/mocha/gesture_test.js | 4 ++-- packages/blockly/tests/mocha/icon_test.js | 4 ++-- packages/blockly/tests/mocha/index.html | 16 +++++++++++++++- packages/blockly/tests/mocha/input_test.js | 2 +- .../blockly/tests/mocha/insertion_marker_test.js | 2 +- .../tests/mocha/jso_deserialization_test.js | 4 ++-- .../tests/mocha/jso_serialization_test.js | 4 ++-- packages/blockly/tests/mocha/json_test.js | 2 +- .../tests/mocha/keyboard_movement_test.js | 4 ++-- .../mocha/keyboard_navigation_controller_test.js | 2 +- .../tests/mocha/keyboard_navigation_test.js | 4 ++-- packages/blockly/tests/mocha/layering_test.js | 2 +- packages/blockly/tests/mocha/menu_item_test.js | 2 +- packages/blockly/tests/mocha/metrics_test.js | 2 +- packages/blockly/tests/mocha/mutator_test.js | 2 +- packages/blockly/tests/mocha/names_test.js | 2 +- packages/blockly/tests/mocha/navigation_test.js | 2 +- .../tests/mocha/old_workspace_comment_test.js | 2 +- .../blockly/tests/mocha/procedure_map_test.js | 2 +- packages/blockly/tests/mocha/rect_test.js | 2 +- packages/blockly/tests/mocha/registry_test.js | 2 +- .../tests/mocha/render_management_test.js | 2 +- packages/blockly/tests/mocha/serializer_test.js | 4 ++-- .../blockly/tests/mocha/shortcut_items_test.js | 4 ++-- .../tests/mocha/shortcut_registry_test.js | 2 +- .../tests/mocha/test_helpers/code_generation.js | 2 +- .../blockly/tests/mocha/test_helpers/events.js | 2 +- .../blockly/tests/mocha/test_helpers/fields.js | 2 +- .../tests/mocha/test_helpers/icon_mocks.js | 8 ++++---- .../tests/mocha/test_helpers/p5_blocks.js | 2 +- .../tests/mocha/test_helpers/procedures.js | 6 +++--- .../tests/mocha/test_helpers/serialization.js | 2 +- .../tests/mocha/test_helpers/setup_teardown.js | 4 ++-- .../tests/mocha/test_helpers/user_input.js | 2 +- .../tests/mocha/test_helpers/variables.js | 2 +- .../blockly/tests/mocha/test_helpers/warnings.js | 2 +- .../tests/mocha/test_helpers/workspace.js | 4 ++-- packages/blockly/tests/mocha/theme_test.js | 4 ++-- packages/blockly/tests/mocha/toast_test.js | 2 +- packages/blockly/tests/mocha/toolbox_test.js | 2 +- packages/blockly/tests/mocha/tooltip_test.js | 2 +- packages/blockly/tests/mocha/touch_test.js | 2 +- packages/blockly/tests/mocha/trashcan_test.js | 6 +++--- packages/blockly/tests/mocha/utils_test.js | 2 +- .../blockly/tests/mocha/variable_map_test.js | 2 +- .../blockly/tests/mocha/variable_model_test.js | 2 +- packages/blockly/tests/mocha/widget_div_test.js | 2 +- .../tests/mocha/workspace_comment_test.js | 2 +- .../blockly/tests/mocha/workspace_svg_test.js | 4 ++-- packages/blockly/tests/mocha/xml_test.js | 2 +- .../blockly/tests/mocha/zoom_controls_test.js | 4 ++-- 111 files changed, 195 insertions(+), 177 deletions(-) diff --git a/packages/blockly/package.json b/packages/blockly/package.json index 7018ad0bd21..71770f31bad 100644 --- a/packages/blockly/package.json +++ b/packages/blockly/package.json @@ -19,6 +19,10 @@ "browser": { "jsdom": false }, + "imports": { + "#core/*": "./build/src/core/*", + "#generators/*": "./build/src/generators/*" + }, "scripts": { "build": "gulp build", "build-debug": "gulp build --verbose --debug", diff --git a/packages/blockly/tests/mocha/aria_test.js b/packages/blockly/tests/mocha/aria_test.js index 20bb35aa5c6..b68954a06da 100644 --- a/packages/blockly/tests/mocha/aria_test.js +++ b/packages/blockly/tests/mocha/aria_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {getInputLabelsSubset} from '../../build/src/core/block_aria_composer.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {getInputLabelsSubset} from '#core/block_aria_composer.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/block_json_test.js b/packages/blockly/tests/mocha/block_json_test.js index 02ed05a012d..507738ecc9a 100644 --- a/packages/blockly/tests/mocha/block_json_test.js +++ b/packages/blockly/tests/mocha/block_json_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Align} from '../../build/src/core/inputs/align.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {Align} from '#core/inputs/align.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/block_test.js b/packages/blockly/tests/mocha/block_test.js index 9762f466ce5..d7c4dd99bda 100644 --- a/packages/blockly/tests/mocha/block_test.js +++ b/packages/blockly/tests/mocha/block_test.js @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {ConnectionType} from '../../build/src/core/connection_type.js'; -import {EventType} from '../../build/src/core/events/type.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; -import {IconType} from '../../build/src/core/icons/icon_types.js'; -import {EndRowInput} from '../../build/src/core/inputs/end_row_input.js'; -import {isCommentIcon} from '../../build/src/core/interfaces/i_comment_icon.js'; -import {Size} from '../../build/src/core/utils/size.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {ConnectionType} from '#core/connection_type.js'; +import {EventType} from '#core/events/type.js'; +import * as eventUtils from '#core/events/utils.js'; +import {IconType} from '#core/icons/icon_types.js'; +import {EndRowInput} from '#core/inputs/end_row_input.js'; +import {isCommentIcon} from '#core/interfaces/i_comment_icon.js'; +import {Size} from '#core/utils/size.js'; +import {assert} from 'chai'; import {createRenderedBlock} from './test_helpers/block_definitions.js'; import { createChangeListenerSpy, diff --git a/packages/blockly/tests/mocha/blocks/lists_test.js b/packages/blockly/tests/mocha/blocks/lists_test.js index e749fae90a7..9fafbb54788 100644 --- a/packages/blockly/tests/mocha/blocks/lists_test.js +++ b/packages/blockly/tests/mocha/blocks/lists_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {ConnectionType} from '../../../build/src/core/connection_type.js'; -import {assert} from '../../../node_modules/chai/index.js'; +import {ConnectionType} from '#core/connection_type.js'; +import {assert} from 'chai'; import {defineStatementBlock} from '../test_helpers/block_definitions.js'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; import { diff --git a/packages/blockly/tests/mocha/blocks/logic_ternary_test.js b/packages/blockly/tests/mocha/blocks/logic_ternary_test.js index 3d343a7caec..fd0998cafe8 100644 --- a/packages/blockly/tests/mocha/blocks/logic_ternary_test.js +++ b/packages/blockly/tests/mocha/blocks/logic_ternary_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as eventUtils from '../../../build/src/core/events/utils.js'; -import {assert} from '../../../node_modules/chai/index.js'; +import * as eventUtils from '#core/events/utils.js'; +import {assert} from 'chai'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; import { sharedTestSetup, diff --git a/packages/blockly/tests/mocha/blocks/loops_test.js b/packages/blockly/tests/mocha/blocks/loops_test.js index eb040c884a7..ebc0ad0bc6a 100644 --- a/packages/blockly/tests/mocha/blocks/loops_test.js +++ b/packages/blockly/tests/mocha/blocks/loops_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../../build/src/core/blockly.js'; -import {assert} from '../../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/blocks/procedures_test.js b/packages/blockly/tests/mocha/blocks/procedures_test.js index 8e226186bbe..87ce1478134 100644 --- a/packages/blockly/tests/mocha/blocks/procedures_test.js +++ b/packages/blockly/tests/mocha/blocks/procedures_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../../build/src/core/blockly.js'; -import {assert} from '../../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import {defineRowBlock} from '../test_helpers/block_definitions.js'; import { assertCallBlockStructure, diff --git a/packages/blockly/tests/mocha/blocks/variables_test.js b/packages/blockly/tests/mocha/blocks/variables_test.js index 724e2e543d0..0b440d9a19f 100644 --- a/packages/blockly/tests/mocha/blocks/variables_test.js +++ b/packages/blockly/tests/mocha/blocks/variables_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {nameUsedWithConflictingParam} from '../../../build/src/core/variables.js'; -import {assert} from '../../../node_modules/chai/index.js'; +import {nameUsedWithConflictingParam} from '#core/variables.js'; +import {assert} from 'chai'; import { MockParameterModelWithVar, MockProcedureModel, diff --git a/packages/blockly/tests/mocha/clipboard_test.js b/packages/blockly/tests/mocha/clipboard_test.js index ff49c0e303c..cbba541fc19 100644 --- a/packages/blockly/tests/mocha/clipboard_test.js +++ b/packages/blockly/tests/mocha/clipboard_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { assertEventFired, createChangeListenerSpy, diff --git a/packages/blockly/tests/mocha/comment_deserialization_test.js b/packages/blockly/tests/mocha/comment_deserialization_test.js index 8299b8215d2..e4a1dc6dae9 100644 --- a/packages/blockly/tests/mocha/comment_deserialization_test.js +++ b/packages/blockly/tests/mocha/comment_deserialization_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/comment_test.js b/packages/blockly/tests/mocha/comment_test.js index eb0f6ab9d75..feab6bda14f 100644 --- a/packages/blockly/tests/mocha/comment_test.js +++ b/packages/blockly/tests/mocha/comment_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {EventType} from '#core/events/type.js'; +import {assert} from 'chai'; import {assertEventFired} from './test_helpers/events.js'; import { sharedTestSetup, diff --git a/packages/blockly/tests/mocha/comment_view_test.js b/packages/blockly/tests/mocha/comment_view_test.js index a60a7a973ff..068649c77f1 100644 --- a/packages/blockly/tests/mocha/comment_view_test.js +++ b/packages/blockly/tests/mocha/comment_view_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/connection_checker_test.js b/packages/blockly/tests/mocha/connection_checker_test.js index bdbcb70a6ec..3c50dd03d76 100644 --- a/packages/blockly/tests/mocha/connection_checker_test.js +++ b/packages/blockly/tests/mocha/connection_checker_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {ConnectionType} from '../../build/src/core/connection_type.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {ConnectionType} from '#core/connection_type.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/connection_db_test.js b/packages/blockly/tests/mocha/connection_db_test.js index 459c59e3ab4..7b8afd2118d 100644 --- a/packages/blockly/tests/mocha/connection_db_test.js +++ b/packages/blockly/tests/mocha/connection_db_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {ConnectionType} from '../../build/src/core/connection_type.js'; -import * as idGenerator from '../../build/src/core/utils/idgenerator.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {ConnectionType} from '#core/connection_type.js'; +import * as idGenerator from '#core/utils/idgenerator.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/connection_test.js b/packages/blockly/tests/mocha/connection_test.js index b36f358eac3..5931d87ef42 100644 --- a/packages/blockly/tests/mocha/connection_test.js +++ b/packages/blockly/tests/mocha/connection_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { defineRowBlock, defineStackBlock, diff --git a/packages/blockly/tests/mocha/contextmenu_items_test.js b/packages/blockly/tests/mocha/contextmenu_items_test.js index 3316d626b0a..8021252f9a5 100644 --- a/packages/blockly/tests/mocha/contextmenu_items_test.js +++ b/packages/blockly/tests/mocha/contextmenu_items_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/contextmenu_test.js b/packages/blockly/tests/mocha/contextmenu_test.js index 8cd71172766..3aa2ce5fcca 100644 --- a/packages/blockly/tests/mocha/contextmenu_test.js +++ b/packages/blockly/tests/mocha/contextmenu_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {callbackFactory} from '../../build/src/core/contextmenu.js'; -import * as xmlUtils from '../../build/src/core/utils/xml.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {callbackFactory} from '#core/contextmenu.js'; +import * as xmlUtils from '#core/utils/xml.js'; +import {assert} from 'chai'; import { defineRowBlock, defineStackBlock, diff --git a/packages/blockly/tests/mocha/dialog_test.js b/packages/blockly/tests/mocha/dialog_test.js index ef8e17cf714..7ade12362ce 100644 --- a/packages/blockly/tests/mocha/dialog_test.js +++ b/packages/blockly/tests/mocha/dialog_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/dropdowndiv_test.js b/packages/blockly/tests/mocha/dropdowndiv_test.js index 62e8c3dc923..bc9df1a23b5 100644 --- a/packages/blockly/tests/mocha/dropdowndiv_test.js +++ b/packages/blockly/tests/mocha/dropdowndiv_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Rect} from '../../build/src/core/utils/rect.js'; -import * as style from '../../build/src/core/utils/style.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {Rect} from '#core/utils/rect.js'; +import * as style from '#core/utils/style.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, @@ -196,6 +196,9 @@ suite('DropDownDiv', function () { }); test('sets the dropdowndiv as owned by the workspace', function () { + // Set the bounds element explicitly rather than relying on a previous + // test having set this module-global, so this test is order-independent. + Blockly.DropDownDiv.setBoundsElement(document.body); const block = this.setUpBlockWithField(); const field = Array.from(block.getFields())[0]; diff --git a/packages/blockly/tests/mocha/event_block_change_test.js b/packages/blockly/tests/mocha/event_block_change_test.js index 9e1f9c3103e..de459a9c039 100644 --- a/packages/blockly/tests/mocha/event_block_change_test.js +++ b/packages/blockly/tests/mocha/event_block_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import {defineMutatorBlocks} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/packages/blockly/tests/mocha/event_block_create_test.js b/packages/blockly/tests/mocha/event_block_create_test.js index b0f5001de33..2cdbcba232a 100644 --- a/packages/blockly/tests/mocha/event_block_create_test.js +++ b/packages/blockly/tests/mocha/event_block_create_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {EventType} from '#core/events/type.js'; +import {assert} from 'chai'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import {assertEventFired} from './test_helpers/events.js'; import { diff --git a/packages/blockly/tests/mocha/event_block_delete_test.js b/packages/blockly/tests/mocha/event_block_delete_test.js index e2fb5b8ce88..f423a4064bb 100644 --- a/packages/blockly/tests/mocha/event_block_delete_test.js +++ b/packages/blockly/tests/mocha/event_block_delete_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/packages/blockly/tests/mocha/event_block_drag_test.js b/packages/blockly/tests/mocha/event_block_drag_test.js index cc71e3bf084..c4859ddc086 100644 --- a/packages/blockly/tests/mocha/event_block_drag_test.js +++ b/packages/blockly/tests/mocha/event_block_drag_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/packages/blockly/tests/mocha/event_block_field_intermediate_change_test.js b/packages/blockly/tests/mocha/event_block_field_intermediate_change_test.js index d917dadcdd5..7a4c23bd575 100644 --- a/packages/blockly/tests/mocha/event_block_field_intermediate_change_test.js +++ b/packages/blockly/tests/mocha/event_block_field_intermediate_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_block_move_test.js b/packages/blockly/tests/mocha/event_block_move_test.js index 6d1890eebeb..c29d9a6ae8d 100644 --- a/packages/blockly/tests/mocha/event_block_move_test.js +++ b/packages/blockly/tests/mocha/event_block_move_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/packages/blockly/tests/mocha/event_bubble_open_test.js b/packages/blockly/tests/mocha/event_bubble_open_test.js index a445a6a7819..12ccd774b29 100644 --- a/packages/blockly/tests/mocha/event_bubble_open_test.js +++ b/packages/blockly/tests/mocha/event_bubble_open_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import {defineMutatorBlocks} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/packages/blockly/tests/mocha/event_click_test.js b/packages/blockly/tests/mocha/event_click_test.js index 5c4afbcadf9..00d3feb2fcf 100644 --- a/packages/blockly/tests/mocha/event_click_test.js +++ b/packages/blockly/tests/mocha/event_click_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, diff --git a/packages/blockly/tests/mocha/event_comment_change_test.js b/packages/blockly/tests/mocha/event_comment_change_test.js index edb539ef555..e25b008b93c 100644 --- a/packages/blockly/tests/mocha/event_comment_change_test.js +++ b/packages/blockly/tests/mocha/event_comment_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_comment_collapse_test.js b/packages/blockly/tests/mocha/event_comment_collapse_test.js index 5c3f61054a1..d7cd95aa071 100644 --- a/packages/blockly/tests/mocha/event_comment_collapse_test.js +++ b/packages/blockly/tests/mocha/event_comment_collapse_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_comment_create_test.js b/packages/blockly/tests/mocha/event_comment_create_test.js index 71ef8ed1b75..1ba9bd2ea69 100644 --- a/packages/blockly/tests/mocha/event_comment_create_test.js +++ b/packages/blockly/tests/mocha/event_comment_create_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_comment_delete_test.js b/packages/blockly/tests/mocha/event_comment_delete_test.js index dd9f0dd2286..7b880c34ee0 100644 --- a/packages/blockly/tests/mocha/event_comment_delete_test.js +++ b/packages/blockly/tests/mocha/event_comment_delete_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_comment_drag_test.js b/packages/blockly/tests/mocha/event_comment_drag_test.js index f6685cc5bdf..2e9c385a460 100644 --- a/packages/blockly/tests/mocha/event_comment_drag_test.js +++ b/packages/blockly/tests/mocha/event_comment_drag_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_comment_move_test.js b/packages/blockly/tests/mocha/event_comment_move_test.js index b3acea990a6..68e28f91d32 100644 --- a/packages/blockly/tests/mocha/event_comment_move_test.js +++ b/packages/blockly/tests/mocha/event_comment_move_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_comment_resize_test.js b/packages/blockly/tests/mocha/event_comment_resize_test.js index bed3e733a65..7b092497ab7 100644 --- a/packages/blockly/tests/mocha/event_comment_resize_test.js +++ b/packages/blockly/tests/mocha/event_comment_resize_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_selected_test.js b/packages/blockly/tests/mocha/event_selected_test.js index d5fefea0d75..b0c4d1d4130 100644 --- a/packages/blockly/tests/mocha/event_selected_test.js +++ b/packages/blockly/tests/mocha/event_selected_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import {createChangeListenerSpy} from './test_helpers/events.js'; import { diff --git a/packages/blockly/tests/mocha/event_test.js b/packages/blockly/tests/mocha/event_test.js index 0bd9dd6b961..eb43b099deb 100644 --- a/packages/blockly/tests/mocha/event_test.js +++ b/packages/blockly/tests/mocha/event_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import * as eventUtils from '#core/events/utils.js'; +import {assert} from 'chai'; import { assertEventEquals, assertNthCallEventArgEquals, diff --git a/packages/blockly/tests/mocha/event_theme_change_test.js b/packages/blockly/tests/mocha/event_theme_change_test.js index 396347c9e13..f514599d131 100644 --- a/packages/blockly/tests/mocha/event_theme_change_test.js +++ b/packages/blockly/tests/mocha/event_theme_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_toolbox_item_select_test.js b/packages/blockly/tests/mocha/event_toolbox_item_select_test.js index 02484c35bc1..5bbb879e304 100644 --- a/packages/blockly/tests/mocha/event_toolbox_item_select_test.js +++ b/packages/blockly/tests/mocha/event_toolbox_item_select_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_trashcan_open_test.js b/packages/blockly/tests/mocha/event_trashcan_open_test.js index 47da09a075a..80869b4d50d 100644 --- a/packages/blockly/tests/mocha/event_trashcan_open_test.js +++ b/packages/blockly/tests/mocha/event_trashcan_open_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_var_create_test.js b/packages/blockly/tests/mocha/event_var_create_test.js index 79af41281de..730c5fcd236 100644 --- a/packages/blockly/tests/mocha/event_var_create_test.js +++ b/packages/blockly/tests/mocha/event_var_create_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_var_delete_test.js b/packages/blockly/tests/mocha/event_var_delete_test.js index 93d9ef0ba2d..098b5a6a43c 100644 --- a/packages/blockly/tests/mocha/event_var_delete_test.js +++ b/packages/blockly/tests/mocha/event_var_delete_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_var_rename_test.js b/packages/blockly/tests/mocha/event_var_rename_test.js index b6d77cb35bd..1edefe3a4f3 100644 --- a/packages/blockly/tests/mocha/event_var_rename_test.js +++ b/packages/blockly/tests/mocha/event_var_rename_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_var_type_change_test.js b/packages/blockly/tests/mocha/event_var_type_change_test.js index 066c145a3ef..3a7cd890c47 100644 --- a/packages/blockly/tests/mocha/event_var_type_change_test.js +++ b/packages/blockly/tests/mocha/event_var_type_change_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/event_viewport_test.js b/packages/blockly/tests/mocha/event_viewport_test.js index cd11079fa32..fbf0c780e36 100644 --- a/packages/blockly/tests/mocha/event_viewport_test.js +++ b/packages/blockly/tests/mocha/event_viewport_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/extensions_test.js b/packages/blockly/tests/mocha/extensions_test.js index 8c41861d5d8..515d70378c3 100644 --- a/packages/blockly/tests/mocha/extensions_test.js +++ b/packages/blockly/tests/mocha/extensions_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/field_checkbox_test.js b/packages/blockly/tests/mocha/field_checkbox_test.js index 2c5a249e992..e432ecd73f4 100644 --- a/packages/blockly/tests/mocha/field_checkbox_test.js +++ b/packages/blockly/tests/mocha/field_checkbox_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import { assertFieldValue, diff --git a/packages/blockly/tests/mocha/field_dropdown_test.js b/packages/blockly/tests/mocha/field_dropdown_test.js index e08b2202f60..20f77c7e69a 100644 --- a/packages/blockly/tests/mocha/field_dropdown_test.js +++ b/packages/blockly/tests/mocha/field_dropdown_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import { createTestBlock, defineRowBlock, diff --git a/packages/blockly/tests/mocha/field_image_test.js b/packages/blockly/tests/mocha/field_image_test.js index 36607f9e0b5..83d867a9e15 100644 --- a/packages/blockly/tests/mocha/field_image_test.js +++ b/packages/blockly/tests/mocha/field_image_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import { assertFieldValue, runConstructorSuiteTests, diff --git a/packages/blockly/tests/mocha/field_label_serializable_test.js b/packages/blockly/tests/mocha/field_label_serializable_test.js index 443cc6d1753..3cb6a622be4 100644 --- a/packages/blockly/tests/mocha/field_label_serializable_test.js +++ b/packages/blockly/tests/mocha/field_label_serializable_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import { createTestBlock, defineRowBlock, diff --git a/packages/blockly/tests/mocha/field_label_test.js b/packages/blockly/tests/mocha/field_label_test.js index 6e5cd15226d..586efeb857e 100644 --- a/packages/blockly/tests/mocha/field_label_test.js +++ b/packages/blockly/tests/mocha/field_label_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import {createTestBlock} from './test_helpers/block_definitions.js'; import { assertFieldValue, diff --git a/packages/blockly/tests/mocha/field_number_test.js b/packages/blockly/tests/mocha/field_number_test.js index b950f2b0329..3f21f93612e 100644 --- a/packages/blockly/tests/mocha/field_number_test.js +++ b/packages/blockly/tests/mocha/field_number_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import {defineRowBlock} from './test_helpers/block_definitions.js'; import {runTestCases} from './test_helpers/common.js'; import { diff --git a/packages/blockly/tests/mocha/field_registry_test.js b/packages/blockly/tests/mocha/field_registry_test.js index 1f19477dee1..956a300df0e 100644 --- a/packages/blockly/tests/mocha/field_registry_test.js +++ b/packages/blockly/tests/mocha/field_registry_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/field_test.js b/packages/blockly/tests/mocha/field_test.js index adfc6b43c97..44a588fc636 100644 --- a/packages/blockly/tests/mocha/field_test.js +++ b/packages/blockly/tests/mocha/field_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import { addBlockTypeToCleanup, addMessageToCleanup, diff --git a/packages/blockly/tests/mocha/field_textinput_test.js b/packages/blockly/tests/mocha/field_textinput_test.js index a0faaeba7bc..2dd3a87df77 100644 --- a/packages/blockly/tests/mocha/field_textinput_test.js +++ b/packages/blockly/tests/mocha/field_textinput_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import { createTestBlock, defineRowBlock, diff --git a/packages/blockly/tests/mocha/field_variable_test.js b/packages/blockly/tests/mocha/field_variable_test.js index 06ca1f5b7e4..13f22edc2ed 100644 --- a/packages/blockly/tests/mocha/field_variable_test.js +++ b/packages/blockly/tests/mocha/field_variable_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import { createTestBlock, defineRowBlock, diff --git a/packages/blockly/tests/mocha/flyout_test.js b/packages/blockly/tests/mocha/flyout_test.js index e2812b25ba3..e0e50b1ceb8 100644 --- a/packages/blockly/tests/mocha/flyout_test.js +++ b/packages/blockly/tests/mocha/flyout_test.js @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/index.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/focus_manager_test.js b/packages/blockly/tests/mocha/focus_manager_test.js index 490fa4301b8..531a1506723 100644 --- a/packages/blockly/tests/mocha/focus_manager_test.js +++ b/packages/blockly/tests/mocha/focus_manager_test.js @@ -4,11 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { - FocusManager, - getFocusManager, -} from '../../build/src/core/focus_manager.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {FocusManager, getFocusManager} from '#core/focus_manager.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/focusable_tree_traverser_test.js b/packages/blockly/tests/mocha/focusable_tree_traverser_test.js index a384dd4be45..84e1bae5342 100644 --- a/packages/blockly/tests/mocha/focusable_tree_traverser_test.js +++ b/packages/blockly/tests/mocha/focusable_tree_traverser_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {FocusManager} from '../../build/src/core/focus_manager.js'; -import {FocusableTreeTraverser} from '../../build/src/core/utils/focusable_tree_traverser.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {FocusManager} from '#core/focus_manager.js'; +import {FocusableTreeTraverser} from '#core/utils/focusable_tree_traverser.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/generator_test.js b/packages/blockly/tests/mocha/generator_test.js index 3c377e7c1ab..1fe42a43b90 100644 --- a/packages/blockly/tests/mocha/generator_test.js +++ b/packages/blockly/tests/mocha/generator_test.js @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -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'; -import {LuaGenerator} from '../../build/src/generators/lua/lua_generator.js'; -import {PhpGenerator} from '../../build/src/generators/php/php_generator.js'; -import {PythonGenerator} from '../../build/src/generators/python/python_generator.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {DartGenerator} from '#generators/dart/dart_generator.js'; +import {JavascriptGenerator} from '#generators/javascript/javascript_generator.js'; +import {LuaGenerator} from '#generators/lua/lua_generator.js'; +import {PhpGenerator} from '#generators/php/php_generator.js'; +import {PythonGenerator} from '#generators/python/python_generator.js'; +import {assert} from 'chai'; import { sharedTestSetup, sharedTestTeardown, diff --git a/packages/blockly/tests/mocha/gesture_test.js b/packages/blockly/tests/mocha/gesture_test.js index 686f4f7aa09..648f5754caa 100644 --- a/packages/blockly/tests/mocha/gesture_test.js +++ b/packages/blockly/tests/mocha/gesture_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {EventType} from '../../build/src/core/events/type.js'; -import {assert} from '../../node_modules/chai/index.js'; +import {EventType} from '#core/events/type.js'; +import {assert} from 'chai'; import {defineBasicBlockWithField} from './test_helpers/block_definitions.js'; import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; import { diff --git a/packages/blockly/tests/mocha/icon_test.js b/packages/blockly/tests/mocha/icon_test.js index c3e11879ce2..50a3645f05d 100644 --- a/packages/blockly/tests/mocha/icon_test.js +++ b/packages/blockly/tests/mocha/icon_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as Blockly from '../../build/src/core/blockly.js'; -import {assert} from '../../node_modules/chai/index.js'; +import * as Blockly from '#core/blockly.js'; +import {assert} from 'chai'; import {defineEmptyBlock} from './test_helpers/block_definitions.js'; import {MockIcon, MockSerializableIcon} from './test_helpers/icon_mocks.js'; import { diff --git a/packages/blockly/tests/mocha/index.html b/packages/blockly/tests/mocha/index.html index 53304cb63be..9e1bafec77d 100644 --- a/packages/blockly/tests/mocha/index.html +++ b/packages/blockly/tests/mocha/index.html @@ -5,6 +5,20 @@ Mocha Tests for Blockly + + +