diff --git a/tests/deps.mocha.js b/tests/deps.mocha.js index a686fdda7..f2d550157 100644 --- a/tests/deps.mocha.js +++ b/tests/deps.mocha.js @@ -1,64 +1,73 @@ goog.addDependency('../../tests/mocha/.mocharc.js', [], []); -goog.addDependency('../../tests/mocha/astnode_test.js', ['Blockly.test.astNode'], ['Blockly.ASTNode', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/block_change_event_test.js', ['Blockly.test.blockChangeEvent'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/block_create_event_test.js', ['Blockly.test.blockCreateEvent'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/astnode_test.js', ['Blockly.test.astNode'], ['Blockly.ASTNode', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/block_change_event_test.js', ['Blockly.test.blockChangeEvent'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/block_create_event_test.js', ['Blockly.test.blockCreateEvent'], ['Blockly.Events.utils', 'Blockly.test.helpers.events', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/block_json_test.js', ['Blockly.test.blockJson'], ['Blockly.Input'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/block_test.js', ['Blockly.test.blocks'], ['Blockly.ConnectionType', 'Blockly.Events.utils', 'Blockly.blocks', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/comment_test.js', ['Blockly.test.comments'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/connection_checker_test.js', ['Blockly.test.connectionChecker'], ['Blockly.ConnectionType', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/connection_db_test.js', ['Blockly.test.connectionDb'], ['Blockly.ConnectionType', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/connection_test.js', ['Blockly.test.connection'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/contextmenu_items_test.js', ['Blockly.test.contextMenuItem'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/cursor_test.js', ['Blockly.test.cursor'], ['Blockly.ASTNode', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/dropdowndiv_test.js', ['Blockly.test.dropdown'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/event_test.js', ['Blockly.test.event'], ['Blockly.ASTNode', 'Blockly.Events.utils', 'Blockly.WorkspaceComment', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/extensions_test.js', ['Blockly.test.extensions'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_angle_test.js', ['Blockly.test.fieldAngle'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_checkbox_test.js', ['Blockly.test.fieldCheckbox'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_colour_test.js', ['Blockly.test.fieldColour'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_dropdown_test.js', ['Blockly.test.fieldDropdown'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_image_test.js', ['Blockly.test.fieldImage'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_label_serializable_test.js', ['Blockly.test.fieldLabelSerialization'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_label_test.js', ['Blockly.test.fieldLabel'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_multilineinput_test.js', ['Blockly.test.fieldMultiline'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_number_test.js', ['Blockly.test.fieldNumber'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_registry_test.js', ['Blockly.test.fieldRegistry'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_test.js', ['Blockly.test.fieldTest'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_textinput_test.js', ['Blockly.test.fieldTextInput'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/field_variable_test.js', ['Blockly.test.fieldVariable'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/flyout_test.js', ['Blockly.test.flyout'], ['Blockly.test.helpers', 'Blockly.test.toolboxHelpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/generator_test.js', ['Blockly.test.generator'], ['Blockly.Dart', 'Blockly.JavaScript', 'Blockly.Lua', 'Blockly.PHP', 'Blockly.Python', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/gesture_test.js', ['Blockly.test.gesture'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/input_test.js', ['Blockly.test.input'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/insertion_marker_test.js', ['Blockly.test.insertionMarker'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/jso_deserialization_test.js', ['Blockly.test.jsoDeserialization'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/jso_serialization_test.js', ['Blockly.test.jsoSerialization'], ['Blockly.test.helpers'], {'lang': 'es8', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/json_test.js', ['Blockly.test.json'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/keydown_test.js', ['Blockly.test.keydown'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/logic_ternary_test.js', ['Blockly.test.logicTernary'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/metrics_test.js', ['Blockly.test.metrics'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/mutator_test.js', ['Blockly.test.mutator'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/names_test.js', ['Blockly.test.names'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/procedures_test.js', ['Blockly.test.procedures'], ['Blockly', 'Blockly.Msg', 'Blockly.test.helpers', 'Blockly.test.procedureHelpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/procedures_test_helpers.js', ['Blockly.test.procedureHelpers'], ['Blockly.ConnectionType'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/registry_test.js', ['Blockly.test.registry'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/block_test.js', ['Blockly.test.blocks'], ['Blockly.ConnectionType', 'Blockly.Events.utils', 'Blockly.blocks', 'Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.warnings'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/comment_test.js', ['Blockly.test.comments'], ['Blockly.Events.utils', 'Blockly.test.helpers.events', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/connection_checker_test.js', ['Blockly.test.connectionChecker'], ['Blockly.ConnectionType', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/connection_db_test.js', ['Blockly.test.connectionDb'], ['Blockly.ConnectionType', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/connection_test.js', ['Blockly.test.connection'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/contextmenu_items_test.js', ['Blockly.test.contextMenuItem'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/cursor_test.js', ['Blockly.test.cursor'], ['Blockly.ASTNode', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/dropdowndiv_test.js', ['Blockly.test.dropdown'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/event_test.js', ['Blockly.test.event'], ['Blockly.ASTNode', 'Blockly.Events.utils', 'Blockly.WorkspaceComment', 'Blockly.test.helpers.events', 'Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.variables'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/extensions_test.js', ['Blockly.test.extensions'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_angle_test.js', ['Blockly.test.fieldAngle'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_checkbox_test.js', ['Blockly.test.fieldCheckbox'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_colour_test.js', ['Blockly.test.fieldColour'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_dropdown_test.js', ['Blockly.test.fieldDropdown'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_image_test.js', ['Blockly.test.fieldImage'], ['Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_label_serializable_test.js', ['Blockly.test.fieldLabelSerialization'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_label_test.js', ['Blockly.test.fieldLabel'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_multilineinput_test.js', ['Blockly.test.fieldMultiline'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.codeGeneration', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_number_test.js', ['Blockly.test.fieldNumber'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.common', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_registry_test.js', ['Blockly.test.fieldRegistry'], ['Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.warnings'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_test.js', ['Blockly.test.fieldTest'], ['Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.warnings'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_textinput_test.js', ['Blockly.test.fieldTextInput'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/field_variable_test.js', ['Blockly.test.fieldVariable'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.fields', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/flyout_test.js', ['Blockly.test.flyout'], ['Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.toolboxDefinitions'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/generator_test.js', ['Blockly.test.generator'], ['Blockly.Dart', 'Blockly.JavaScript', 'Blockly.Lua', 'Blockly.PHP', 'Blockly.Python', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/gesture_test.js', ['Blockly.test.gesture'], ['Blockly.Events.utils', 'Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.events', 'Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.userInput'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/input_test.js', ['Blockly.test.input'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/insertion_marker_test.js', ['Blockly.test.insertionMarker'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/jso_deserialization_test.js', ['Blockly.test.jsoDeserialization'], ['Blockly.Events.utils', 'Blockly.test.helpers.events', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/jso_serialization_test.js', ['Blockly.test.jsoSerialization'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es8', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/json_test.js', ['Blockly.test.json'], ['Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.warnings'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/keydown_test.js', ['Blockly.test.keydown'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.userInput'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/logic_ternary_test.js', ['Blockly.test.logicTernary'], ['Blockly.Events.utils', 'Blockly.test.helpers.serialization', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/metrics_test.js', ['Blockly.test.metrics'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/mutator_test.js', ['Blockly.test.mutator'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/names_test.js', ['Blockly.test.names'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/procedures_test.js', ['Blockly.test.procedures'], ['Blockly', 'Blockly.Msg', 'Blockly.test.helpers.procedures', 'Blockly.test.helpers.serialization', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/registry_test.js', ['Blockly.test.registry'], ['Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.warnings'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../tests/mocha/run_mocha_tests_in_browser.js', [], [], {'lang': 'es8'}); -goog.addDependency('../../tests/mocha/serializer_test.js', ['Blockly.test.serialization'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/shortcut_registry_test.js', ['Blockly.test.shortcutRegistry'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/test_helpers.js', ['Blockly.test.helpers'], ['Blockly.Events.utils', 'Blockly.blocks', 'Blockly.utils.KeyCodes'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/theme_test.js', ['Blockly.test.theme'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/toolbox_helper.js', ['Blockly.test.toolboxHelpers'], [], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/toolbox_test.js', ['Blockly.test.toolbox'], ['Blockly.test.helpers', 'Blockly.test.toolboxHelpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/tooltip_test.js', ['Blockly.test.tooltip'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/trashcan_test.js', ['Blockly.test.trashcan'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/utils_test.js', ['Blockly.test.utils'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/variable_map_test.js', ['Blockly.test.variableMap'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/variable_model_test.js', ['Blockly.test.variableModel'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/variables_test.js', ['Blockly.test.variables'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/widget_div_test.js', ['Blockly.test.widgetDiv'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/workspace_comment_test.js', ['Blockly.test.workspaceComment'], ['Blockly.WorkspaceComment', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/workspace_helpers.js', ['Blockly.test.workspaceHelpers'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/workspace_svg_test.js', ['Blockly.test.workspaceSvg'], ['Blockly.Events.utils', 'Blockly.test.helpers', 'Blockly.test.workspaceHelpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/workspace_test.js', ['Blockly.test.workspace'], ['Blockly.test.helpers', 'Blockly.test.workspaceHelpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/xml_test.js', ['Blockly.test.xml'], ['Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../tests/mocha/zoom_controls_test.js', ['Blockly.test.zoomControls'], ['Blockly.Events.utils', 'Blockly.test.helpers'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/serializer_test.js', ['Blockly.test.serialization'], ['Blockly.test.helpers.common', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/shortcut_registry_test.js', ['Blockly.test.shortcutRegistry'], ['Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.userInput'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/test_helpers/block_definitions.js', ['Blockly.test.helpers.blockDefinitions'], [], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/code_generation.js', ['Blockly.test.helpers.codeGeneration'], ['Blockly.test.helpers.common'], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/common.js', ['Blockly.test.helpers.common'], [], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/events.js', ['Blockly.test.helpers.events'], [], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/fields.js', ['Blockly.test.helpers.fields'], ['Blockly.test.helpers.common'], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/procedures.js', ['Blockly.test.helpers.procedures'], ['Blockly.ConnectionType'], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/serialization.js', ['Blockly.test.helpers.serialization'], ['Blockly.test.helpers.common'], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/setup_teardown.js', ['Blockly.test.helpers.setupTeardown'], ['Blockly.Events.utils', 'Blockly.blocks'], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/toolbox_definitions.js', ['Blockly.test.helpers.toolboxDefinitions'], [], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/user_input.js', ['Blockly.test.helpers.userInput'], ['Blockly.utils.KeyCodes'], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/variables.js', ['Blockly.test.helpers.variables'], [], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/warnings.js', ['Blockly.test.helpers.warnings'], [], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/test_helpers/workspace.js', ['Blockly.test.helpers.workspace'], ['Blockly.Events.utils', 'Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.variables', 'Blockly.test.helpers.warnings'], {'lang': 'es6', 'module': 'es6'}); +goog.addDependency('../../tests/mocha/theme_test.js', ['Blockly.test.theme'], ['Blockly.Events.utils', 'Blockly.test.helpers.events', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/toolbox_test.js', ['Blockly.test.toolbox'], ['Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.toolboxDefinitions'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/tooltip_test.js', ['Blockly.test.tooltip'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/trashcan_test.js', ['Blockly.test.trashcan'], ['Blockly.Events.utils', 'Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.events', 'Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.userInput'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/utils_test.js', ['Blockly.test.utils'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/variable_map_test.js', ['Blockly.test.variableMap'], ['Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.variables'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/variable_model_test.js', ['Blockly.test.variableModel'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/variables_test.js', ['Blockly.test.variables'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/widget_div_test.js', ['Blockly.test.widgetDiv'], ['Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/workspace_comment_test.js', ['Blockly.test.workspaceComment'], ['Blockly.WorkspaceComment', 'Blockly.test.helpers.setupTeardown'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/workspace_svg_test.js', ['Blockly.test.workspaceSvg'], ['Blockly.Events.utils', 'Blockly.test.helpers.blockDefinitions', 'Blockly.test.helpers.events', 'Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.variables', 'Blockly.test.helpers.workspace'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/workspace_test.js', ['Blockly.test.workspace'], ['Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.variables', 'Blockly.test.helpers.workspace'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/xml_test.js', ['Blockly.test.xml'], ['Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.variables'], {'lang': 'es6', 'module': 'goog'}); +goog.addDependency('../../tests/mocha/zoom_controls_test.js', ['Blockly.test.zoomControls'], ['Blockly.Events.utils', 'Blockly.test.helpers.events', 'Blockly.test.helpers.setupTeardown', 'Blockly.test.helpers.userInput'], {'lang': 'es6', 'module': 'goog'}); diff --git a/tests/mocha/.eslintrc.json b/tests/mocha/.eslintrc.json index c42c50c20..bf87ec0bd 100644 --- a/tests/mocha/.eslintrc.json +++ b/tests/mocha/.eslintrc.json @@ -1,18 +1,21 @@ { + "parserOptions": { + "sourceType": "module" + }, "env": { "browser": true, "mocha": true }, "globals": { "chai": false, - "sinon": false, - "testHelpers": true + "sinon": false }, "rules": { "no-unused-vars": ["off"], // Allow uncommented helper functions in tests. "require-jsdoc": ["off"], - "prefer-rest-params": ["off"] + "prefer-rest-params": ["off"], + "no-invalid-this": ["off"] }, "extends": "../../.eslintrc.json" } diff --git a/tests/mocha/astnode_test.js b/tests/mocha/astnode_test.js index e370d4dd7..1a15dfb62 100644 --- a/tests/mocha/astnode_test.js +++ b/tests/mocha/astnode_test.js @@ -7,10 +7,11 @@ goog.module('Blockly.test.astNode'); const {ASTNode} = goog.require('Blockly.ASTNode'); -const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('ASTNode', function() { + console.log('1/a'); setup(function() { sharedTestSetup.call(this); Blockly.defineBlocksWithJsonArray([{ @@ -100,7 +101,9 @@ suite('ASTNode', function() { }); suite('HelperFunctions', function() { + console.log('2'); test('findNextForInput_', function() { + console.log('3'); const input = this.blocks.statementInput1.inputList[0]; const input2 = this.blocks.statementInput1.inputList[1]; const connection = input.connection; @@ -169,6 +172,7 @@ suite('ASTNode', function() { }); suite('NavigationFunctions', function() { + console.log('b'); setup(function() { Blockly.defineBlocksWithJsonArray([{ "type": "top_connection", @@ -319,7 +323,9 @@ suite('ASTNode', function() { workspaceTeardown.call(this, this.singleBlockWorkspace); }); + console.log('c'); test('fromPreviousToBlock', function() { + console.log('d'); const prevConnection = this.blocks.statementInput1.previousConnection; const node = ASTNode.createConnectionNode(prevConnection); const nextNode = node.next(); diff --git a/tests/mocha/block_change_event_test.js b/tests/mocha/block_change_event_test.js index e4e3f49cf..6cfbca578 100644 --- a/tests/mocha/block_change_event_test.js +++ b/tests/mocha/block_change_event_test.js @@ -6,7 +6,8 @@ goog.module('Blockly.test.blockChangeEvent'); -const {defineMutatorBlocks, sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {defineMutatorBlocks} = goog.require('Blockly.test.helpers.blockDefinitions'); suite('Block Change Event', function() { diff --git a/tests/mocha/block_create_event_test.js b/tests/mocha/block_create_event_test.js index 69debed96..475991908 100644 --- a/tests/mocha/block_create_event_test.js +++ b/tests/mocha/block_create_event_test.js @@ -6,8 +6,9 @@ goog.module('Blockly.test.blockCreateEvent'); +const {assertEventFired} = goog.require('Blockly.test.helpers.events'); const eventUtils = goog.require('Blockly.Events.utils'); -const {assertEventFired, sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Block Create Event', function() { diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index 36cc583d9..13e515534 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -6,10 +6,12 @@ goog.module('Blockly.test.blocks'); -const eventUtils = goog.require('Blockly.Events.utils'); const {Blocks} = goog.require('Blockly.blocks'); const {ConnectionType} = goog.require('Blockly.ConnectionType'); -const {createDeprecationWarningStub, createRenderedBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {createDeprecationWarningStub} = goog.require('Blockly.test.helpers.warnings'); +const {createRenderedBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); +const eventUtils = goog.require('Blockly.Events.utils'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Blocks', function() { diff --git a/tests/mocha/comment_test.js b/tests/mocha/comment_test.js index 94a496637..afee012f6 100644 --- a/tests/mocha/comment_test.js +++ b/tests/mocha/comment_test.js @@ -6,8 +6,9 @@ goog.module('Blockly.test.comments'); +const {assertEventFired} = goog.require('Blockly.test.helpers.events'); const eventUtils = goog.require('Blockly.Events.utils'); -const {assertEventFired, sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Comments', function() { diff --git a/tests/mocha/connection_checker_test.js b/tests/mocha/connection_checker_test.js index 53582daaf..523fecfcc 100644 --- a/tests/mocha/connection_checker_test.js +++ b/tests/mocha/connection_checker_test.js @@ -7,7 +7,7 @@ goog.module('Blockly.test.connectionChecker'); const {ConnectionType} = goog.require('Blockly.ConnectionType'); -const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Connection checker', function() { diff --git a/tests/mocha/connection_db_test.js b/tests/mocha/connection_db_test.js index 83ec64663..cdc343bd5 100644 --- a/tests/mocha/connection_db_test.js +++ b/tests/mocha/connection_db_test.js @@ -7,7 +7,7 @@ goog.module('Blockly.test.connectionDb'); const {ConnectionType} = goog.require('Blockly.ConnectionType'); -const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Connection Database', function() { diff --git a/tests/mocha/connection_test.js b/tests/mocha/connection_test.js index 24e763683..37bca1240 100644 --- a/tests/mocha/connection_test.js +++ b/tests/mocha/connection_test.js @@ -6,7 +6,8 @@ goog.module('Blockly.test.connection'); -const {assertSingleDeprecationWarningCall, createDeprecationWarningStub, createGenUidStubWithReturns, defineRowBlock, defineStatementBlock, defineStackBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {createGenUidStubWithReturns, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {defineRowBlock, defineStatementBlock, defineStackBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); suite('Connection', function() { diff --git a/tests/mocha/contextmenu_items_test.js b/tests/mocha/contextmenu_items_test.js index 1c82072e7..c9b9b8127 100644 --- a/tests/mocha/contextmenu_items_test.js +++ b/tests/mocha/contextmenu_items_test.js @@ -6,7 +6,7 @@ goog.module('Blockly.test.contextMenuItem'); -const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Context Menu Items', function() { diff --git a/tests/mocha/cursor_test.js b/tests/mocha/cursor_test.js index a86268d87..77b22470a 100644 --- a/tests/mocha/cursor_test.js +++ b/tests/mocha/cursor_test.js @@ -6,7 +6,7 @@ goog.module('Blockly.test.cursor'); -const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); const {ASTNode} = goog.require('Blockly.ASTNode'); diff --git a/tests/mocha/dropdowndiv_test.js b/tests/mocha/dropdowndiv_test.js index c45aee795..6cd8dca53 100644 --- a/tests/mocha/dropdowndiv_test.js +++ b/tests/mocha/dropdowndiv_test.js @@ -6,7 +6,7 @@ goog.module('Blockly.test.dropdown'); -const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('DropDownDiv', function() { diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index 70ae131b7..2b57b8a98 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -6,9 +6,11 @@ goog.module('Blockly.test.event'); -const eventUtils = goog.require('Blockly.Events.utils'); -const {assertEventEquals, assertNthCallEventArgEquals, assertVariableValues, createFireChangeListenerSpy, createGenUidStubWithReturns, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); const {ASTNode} = goog.require('Blockly.ASTNode'); +const {assertEventEquals, assertNthCallEventArgEquals, createFireChangeListenerSpy} = goog.require('Blockly.test.helpers.events'); +const {assertVariableValues} = goog.require('Blockly.test.helpers.variables'); +const {createGenUidStubWithReturns, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const eventUtils = goog.require('Blockly.Events.utils'); goog.require('Blockly.WorkspaceComment'); diff --git a/tests/mocha/extensions_test.js b/tests/mocha/extensions_test.js index d7846bb81..6c2873ff1 100644 --- a/tests/mocha/extensions_test.js +++ b/tests/mocha/extensions_test.js @@ -6,7 +6,7 @@ goog.module('Blockly.test.extensions'); -const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Extensions', function() { diff --git a/tests/mocha/field_angle_test.js b/tests/mocha/field_angle_test.js index 2d3736e67..1639eb206 100644 --- a/tests/mocha/field_angle_test.js +++ b/tests/mocha/field_angle_test.js @@ -6,7 +6,9 @@ goog.module('Blockly.test.fieldAngle'); -const {createTestBlock, defineRowBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {createTestBlock, defineRowBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Angle Fields', function() { @@ -60,7 +62,7 @@ suite('Angle Fields', function() { * @param {FieldTemplate} field The field to check. */ const assertFieldDefault = function(field) { - testHelpers.assertFieldValue(field, defaultFieldValue); + assertFieldValue(field, defaultFieldValue); }; /** * Asserts that the field properties are correct based on the test case. @@ -68,14 +70,14 @@ suite('Angle Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue(field, testCase.expectedValue); + assertFieldValue(field, testCase.expectedValue); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldAngle, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldAngle, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); @@ -84,12 +86,12 @@ suite('Angle Fields', function() { setup(function() { this.field = new Blockly.FieldAngle(); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, defaultFieldValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue(2.5); - testHelpers.assertFieldValue(this.field, 2.5); + assertFieldValue(this.field, 2.5); }); }); suite('Value -> New Value', function() { @@ -97,12 +99,12 @@ suite('Angle Fields', function() { setup(function() { this.field = new Blockly.FieldAngle(initialValue); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, initialValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue(2.5); - testHelpers.assertFieldValue(this.field, 2.5); + assertFieldValue(this.field, 2.5); }); }); }); @@ -142,12 +144,12 @@ suite('Angle Fields', function() { this.field.isBeingEdited_ = true; this.field.htmlInput_.value = String(suiteInfo.value); this.field.onHtmlInputChange_(null); - testHelpers.assertFieldValue( + assertFieldValue( this.field, suiteInfo.expectedValue, String(suiteInfo.value)); }); test('When Not Editing', function() { this.field.setValue(suiteInfo.value); - testHelpers.assertFieldValue(this.field, suiteInfo.expectedValue); + assertFieldValue(this.field, suiteInfo.expectedValue); }); }); }); diff --git a/tests/mocha/field_checkbox_test.js b/tests/mocha/field_checkbox_test.js index 2c6b8eeb2..5de565984 100644 --- a/tests/mocha/field_checkbox_test.js +++ b/tests/mocha/field_checkbox_test.js @@ -6,7 +6,9 @@ goog.module('Blockly.test.fieldCheckbox'); -const {defineRowBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {defineRowBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); suite('Checkbox Fields', function() { @@ -61,7 +63,7 @@ suite('Checkbox Fields', function() { * @param {!Blockly.FieldCheckbox} field The field to check. */ const assertFieldDefault = function(field) { - testHelpers.assertFieldValue( + assertFieldValue( field, defaultFieldValue, defaultFieldValue.toLowerCase()); }; /** @@ -70,15 +72,15 @@ suite('Checkbox Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue( + assertFieldValue( field, testCase.expectedValue, testCase.expectedValue.toLowerCase()); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldCheckbox, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldCheckbox, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); @@ -87,14 +89,14 @@ suite('Checkbox Fields', function() { setup(function() { this.field = new Blockly.FieldCheckbox('TRUE'); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, 'TRUE', 'true'); }); suite('False -> New Value', function() { setup(function() { this.field = new Blockly.FieldCheckbox('FALSE'); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, 'FALSE', 'false'); }); }); @@ -131,7 +133,7 @@ suite('Checkbox Fields', function() { }); test('New Value', function() { this.field.setValue(suiteInfo.value); - testHelpers.assertFieldValue( + assertFieldValue( this.field, suiteInfo.expectedValue, String(suiteInfo.expectedValue).toLowerCase()); }); diff --git a/tests/mocha/field_colour_test.js b/tests/mocha/field_colour_test.js index 97fd27c96..eb0389702 100644 --- a/tests/mocha/field_colour_test.js +++ b/tests/mocha/field_colour_test.js @@ -6,7 +6,9 @@ goog.module('Blockly.test.fieldColour'); -const {createTestBlock, defineRowBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {createTestBlock, defineRowBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Colour Fields', function() { @@ -87,7 +89,7 @@ suite('Colour Fields', function() { * @param {FieldTemplate} field The field to check. */ const assertFieldDefault = function(field) { - testHelpers.assertFieldValue(field, defaultFieldValue, defaultTextValue); + assertFieldValue(field, defaultFieldValue, defaultTextValue); }; /** * Asserts that the field properties are correct based on the test case. @@ -95,15 +97,15 @@ suite('Colour Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue( + assertFieldValue( field, testCase.expectedValue, testCase.expectedText); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldColour, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldColour, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); @@ -112,25 +114,25 @@ suite('Colour Fields', function() { setup(function() { this.field = new Blockly.FieldColour(); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, defaultFieldValue, defaultTextValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('#bcbcbc'); - testHelpers.assertFieldValue(this.field, '#bcbcbc', '#bcbcbc'); + assertFieldValue(this.field, '#bcbcbc', '#bcbcbc'); }); }); suite('Value -> New Value', function() { setup(function() { this.field = new Blockly.FieldColour('#aaaaaa'); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, '#aaaaaa', '#aaa'); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('#bcbcbc'); - testHelpers.assertFieldValue(this.field, '#bcbcbc', '#bcbcbc'); + assertFieldValue(this.field, '#bcbcbc', '#bcbcbc'); }); }); }); @@ -161,7 +163,7 @@ suite('Colour Fields', function() { }); test('New Value', function() { this.field.setValue(suiteInfo.value); - testHelpers.assertFieldValue( + assertFieldValue( this.field, suiteInfo.expectedValue, suiteInfo.expectedText); }); }); diff --git a/tests/mocha/field_dropdown_test.js b/tests/mocha/field_dropdown_test.js index 11b517b6e..1b67525f4 100644 --- a/tests/mocha/field_dropdown_test.js +++ b/tests/mocha/field_dropdown_test.js @@ -6,7 +6,9 @@ goog.module('Blockly.test.fieldDropdown'); -const {createTestBlock, defineRowBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {createTestBlock, defineRowBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Dropdown Fields', function() { @@ -74,14 +76,14 @@ suite('Dropdown Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue(field, testCase.expectedValue, testCase.expectedText); + assertFieldValue(field, testCase.expectedValue, testCase.expectedText); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldDropdown, validValueCreationTestCases, invalidValueCreationTestCases, validTestCaseAssertField); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldDropdown, validValueCreationTestCases, invalidValueCreationTestCases, validTestCaseAssertField); @@ -107,12 +109,12 @@ suite('Dropdown Fields', function() { this.field = new Blockly.FieldDropdown( [['a', 'A'], ['b', 'B'], ['c', 'C']]); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueSetValueTestCases, invalidValueSetValueTestCases, 'A', 'a'); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('B'); - testHelpers.assertFieldValue(this.field, 'B', 'b'); + assertFieldValue(this.field, 'B', 'b'); }); }); @@ -133,7 +135,7 @@ suite('Dropdown Fields', function() { }); test('New Value', function() { this.dropdownField.setValue('1B'); - testHelpers.assertFieldValue(this.dropdownField, '1A', '1a'); + assertFieldValue(this.dropdownField, '1A', '1a'); }); }); suite('Force 1s Validator', function() { @@ -144,7 +146,7 @@ suite('Dropdown Fields', function() { }); test('New Value', function() { this.dropdownField.setValue('2B'); - testHelpers.assertFieldValue(this.dropdownField, '1B', '1b'); + assertFieldValue(this.dropdownField, '1B', '1b'); }); }); suite('Returns Undefined Validator', function() { @@ -153,7 +155,7 @@ suite('Dropdown Fields', function() { }); test('New Value', function() { this.dropdownField.setValue('1B'); - testHelpers.assertFieldValue(this.dropdownField, '1B', '1b'); + assertFieldValue(this.dropdownField, '1B', '1b'); }); }); }); diff --git a/tests/mocha/field_image_test.js b/tests/mocha/field_image_test.js index fcc68fd67..62826398a 100644 --- a/tests/mocha/field_image_test.js +++ b/tests/mocha/field_image_test.js @@ -6,7 +6,8 @@ goog.module('Blockly.test.fieldImage'); -const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Image Fields', function() { @@ -56,14 +57,14 @@ suite('Image Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue(field, testCase.expectedValue, testCase.expectedText); + assertFieldValue(field, testCase.expectedValue, testCase.expectedText); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldImage, validValueCreationTestCases, invalidValueTestCases, validTestCaseAssertField); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldImage, validValueCreationTestCases, invalidValueTestCases, validTestCaseAssertField); @@ -80,7 +81,7 @@ suite('Image Fields', function() { setup(function() { this.field = new Blockly.FieldImage('src', 1, 1, 'alt'); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueSetValueTestCases, invalidValueTestCases, 'src', 'alt'); }); @@ -126,15 +127,15 @@ suite('Image Fields', function() { }); test('Null', function() { this.imageField.setAlt(null); - testHelpers.assertFieldValue(this.imageField, 'src', ''); + assertFieldValue(this.imageField, 'src', ''); }); test('Empty String', function() { this.imageField.setAlt(''); - testHelpers.assertFieldValue(this.imageField, 'src', ''); + assertFieldValue(this.imageField, 'src', ''); }); test('Good Alt', function() { this.imageField.setAlt('newAlt'); - testHelpers.assertFieldValue(this.imageField, 'src', 'newAlt'); + assertFieldValue(this.imageField, 'src', 'newAlt'); }); }); test('JS Configuration - Simple', function() { diff --git a/tests/mocha/field_label_serializable_test.js b/tests/mocha/field_label_serializable_test.js index 212173b2a..b5ba42824 100644 --- a/tests/mocha/field_label_serializable_test.js +++ b/tests/mocha/field_label_serializable_test.js @@ -6,7 +6,9 @@ goog.module('Blockly.test.fieldLabelSerialization'); -const {createTestBlock, defineRowBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {createTestBlock, defineRowBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); suite('Label Serializable Fields', function() { @@ -53,7 +55,7 @@ suite('Label Serializable Fields', function() { * @param {!Blockly.FieldLabelSerializable} field The field to check. */ const assertFieldDefault = function(field) { - testHelpers.assertFieldValue(field, defaultFieldValue); + assertFieldValue(field, defaultFieldValue); }; /** * Asserts that the field properties are correct based on the test case. @@ -61,14 +63,14 @@ suite('Label Serializable Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue(field, testCase.expectedValue); + assertFieldValue(field, testCase.expectedValue); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldLabelSerializable, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldLabelSerializable, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); @@ -77,12 +79,12 @@ suite('Label Serializable Fields', function() { setup(function() { this.field = new Blockly.FieldLabelSerializable(); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, defaultFieldValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('value'); - testHelpers.assertFieldValue(this.field, 'value'); + assertFieldValue(this.field, 'value'); }); }); suite('Value -> New Value', function() { @@ -90,12 +92,12 @@ suite('Label Serializable Fields', function() { setup(function() { this.field = new Blockly.FieldLabelSerializable(initialValue); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, initialValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('value'); - testHelpers.assertFieldValue(this.field, 'value'); + assertFieldValue(this.field, 'value'); }); }); }); diff --git a/tests/mocha/field_label_test.js b/tests/mocha/field_label_test.js index 52fedef90..62f088b96 100644 --- a/tests/mocha/field_label_test.js +++ b/tests/mocha/field_label_test.js @@ -6,7 +6,9 @@ goog.module('Blockly.test.fieldLabel'); -const {createTestBlock, sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {createTestBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); suite('Label Fields', function() { @@ -53,7 +55,7 @@ suite('Label Fields', function() { * @param {!Blockly.FieldLabel} field The field to check. */ const assertFieldDefault = function(field) { - testHelpers.assertFieldValue(field, defaultFieldValue); + assertFieldValue(field, defaultFieldValue); }; /** * Asserts that the field properties are correct based on the test case. @@ -61,14 +63,14 @@ suite('Label Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue(field, testCase.expectedValue); + assertFieldValue(field, testCase.expectedValue); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldLabel, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldLabel, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); @@ -77,12 +79,12 @@ suite('Label Fields', function() { setup(function() { this.field = new Blockly.FieldLabel(); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, defaultFieldValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('value'); - testHelpers.assertFieldValue(this.field, 'value'); + assertFieldValue(this.field, 'value'); }); }); suite('Value -> New Value', function() { @@ -90,12 +92,12 @@ suite('Label Fields', function() { setup(function() { this.field = new Blockly.FieldLabel(initialValue); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, initialValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('value'); - testHelpers.assertFieldValue(this.field, 'value'); + assertFieldValue(this.field, 'value'); }); }); }); diff --git a/tests/mocha/field_multilineinput_test.js b/tests/mocha/field_multilineinput_test.js index 8283df431..6096384fe 100644 --- a/tests/mocha/field_multilineinput_test.js +++ b/tests/mocha/field_multilineinput_test.js @@ -6,7 +6,10 @@ goog.module('Blockly.test.fieldMultiline'); -const {createTestBlock, defineRowBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {createTestBlock, defineRowBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {runCodeGenerationTestSuites} = goog.require('Blockly.test.helpers.codeGeneration'); suite('Multiline Input Fields', function() { @@ -55,7 +58,7 @@ suite('Multiline Input Fields', function() { * @param {!Blockly.FieldMultilineInput} field The field to check. */ const assertFieldDefault = function(field) { - testHelpers.assertFieldValue(field, defaultFieldValue); + assertFieldValue(field, defaultFieldValue); }; /** * Asserts that the field properties are correct based on the test case. @@ -63,14 +66,14 @@ suite('Multiline Input Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue(field, testCase.expectedValue); + assertFieldValue(field, testCase.expectedValue); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldMultilineInput, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldMultilineInput, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); @@ -79,12 +82,12 @@ suite('Multiline Input Fields', function() { setup(function() { this.field = new Blockly.FieldMultilineInput(); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, defaultFieldValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('value'); - testHelpers.assertFieldValue(this.field, 'value'); + assertFieldValue(this.field, 'value'); }); }); suite('Value -> New Value', function() { @@ -92,12 +95,12 @@ suite('Multiline Input Fields', function() { setup(function() { this.field = new Blockly.FieldMultilineInput(initialValue); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, initialValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('value'); - testHelpers.assertFieldValue(this.field, 'value'); + assertFieldValue(this.field, 'value'); }); }); }); @@ -156,7 +159,7 @@ suite('Multiline Input Fields', function() { createBlock: createBlockFn('bark bark\n bark bark bark\n bark bar bark bark\n')}, ]}, ]; - testHelpers.runCodeGenerationTestSuites(testSuites); + runCodeGenerationTestSuites(testSuites); }); suite('Serialization', function() { diff --git a/tests/mocha/field_number_test.js b/tests/mocha/field_number_test.js index 379bb5b83..fd23cc661 100644 --- a/tests/mocha/field_number_test.js +++ b/tests/mocha/field_number_test.js @@ -6,7 +6,10 @@ goog.module('Blockly.test.fieldNumber'); -const {defineRowBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {defineRowBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {runTestCases} = goog.require('Blockly.test.helpers.common'); suite('Number Fields', function() { @@ -64,7 +67,7 @@ suite('Number Fields', function() { */ function assertNumberField(field, expectedMin, expectedMax, expectedPrecision, expectedValue) { - testHelpers.assertFieldValue(field, expectedValue); + assertFieldValue(field, expectedValue); chai.assert.equal(field.getMin(), expectedMin, 'Min'); chai.assert.equal(field.getMax(), expectedMax, 'Max'); chai.assert.equal( @@ -88,11 +91,11 @@ suite('Number Fields', function() { testCase.expectedValue, testCase.expectedValue); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldNumber, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldNumber, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); @@ -101,7 +104,7 @@ suite('Number Fields', function() { setup(function() { this.field = new Blockly.FieldNumber(); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, defaultFieldValue); }); suite('Value -> New Value', function() { @@ -109,7 +112,7 @@ suite('Number Fields', function() { setup(function() { this.field = new Blockly.FieldNumber(initialValue); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, initialValue); }); suite('Constraints', function() { @@ -127,11 +130,11 @@ suite('Number Fields', function() { expectedValue: 123}, ]; suite('Precision', function() { - testHelpers.runTestCases(testCases, function(testCase) { + runTestCases(testCases, function(testCase) { return function() { const field = Blockly.FieldNumber.fromJson(testCase.json); field.setValue(testCase.value); - testHelpers.assertFieldValue(field, testCase.expectedValue); + assertFieldValue(field, testCase.expectedValue); }; }); test('Null', function() { @@ -144,7 +147,7 @@ suite('Number Fields', function() { const field = Blockly.FieldNumber.fromJson(testCase.json); testCase.values.forEach(function(value, i) { field.setValue(value); - testHelpers.assertFieldValue( + assertFieldValue( field, testCase.expectedValues[i]); }); }; @@ -158,7 +161,7 @@ suite('Number Fields', function() { {title: '+10', json: {min: 10}, values: [-20, 0, 20], expectedValues: [10, 10, 20]}, ]; - testHelpers.runTestCases(testCases, setValueBoundsTestFn); + runTestCases(testCases, setValueBoundsTestFn); test('Null', function() { const field = Blockly.FieldNumber.fromJson({min: null}); chai.assert.equal(field.getMin(), -Infinity); @@ -173,7 +176,7 @@ suite('Number Fields', function() { {title: '+10', json: {max: 10}, values: [-20, 0, 20], expectedValues: [-20, 0, 10]}, ]; - testHelpers.runTestCases(testCases, setValueBoundsTestFn); + runTestCases(testCases, setValueBoundsTestFn); test('Null', function() { const field = Blockly.FieldNumber.fromJson({max: null}); chai.assert.equal(field.getMax(), Infinity); @@ -217,12 +220,12 @@ suite('Number Fields', function() { this.field.isBeingEdited_ = true; this.field.htmlInput_.value = String(suiteInfo.value); this.field.onHtmlInputChange_(null); - testHelpers.assertFieldValue( + assertFieldValue( this.field, suiteInfo.expectedValue, String(suiteInfo.value)); }); test('When Not Editing', function() { this.field.setValue(suiteInfo.value); - testHelpers.assertFieldValue(this.field, suiteInfo.expectedValue); + assertFieldValue(this.field, suiteInfo.expectedValue); }); }); }); diff --git a/tests/mocha/field_registry_test.js b/tests/mocha/field_registry_test.js index 0df2f6bd0..394081365 100644 --- a/tests/mocha/field_registry_test.js +++ b/tests/mocha/field_registry_test.js @@ -6,7 +6,8 @@ goog.module('Blockly.test.fieldRegistry'); -const {createDeprecationWarningStub, sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {createDeprecationWarningStub} = goog.require('Blockly.test.helpers.warnings'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Field Registry', function() { diff --git a/tests/mocha/field_test.js b/tests/mocha/field_test.js index 0ba6a9e98..4d1887aa0 100644 --- a/tests/mocha/field_test.js +++ b/tests/mocha/field_test.js @@ -6,7 +6,8 @@ goog.module('Blockly.test.fieldTest'); -const {addBlockTypeToCleanup, addMessageToCleanup, createDeprecationWarningStub, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {addBlockTypeToCleanup, addMessageToCleanup, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {createDeprecationWarningStub} = goog.require('Blockly.test.helpers.warnings'); suite('Abstract Fields', function() { diff --git a/tests/mocha/field_textinput_test.js b/tests/mocha/field_textinput_test.js index d95e31204..efd01d702 100644 --- a/tests/mocha/field_textinput_test.js +++ b/tests/mocha/field_textinput_test.js @@ -6,7 +6,9 @@ goog.module('Blockly.test.fieldTextInput'); -const {createTestBlock, defineRowBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {createTestBlock, defineRowBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); +const {sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Text Input Fields', function() { @@ -53,7 +55,7 @@ suite('Text Input Fields', function() { * @param {!Blockly.FieldTextInput} field The field to check. */ const assertFieldDefault = function(field) { - testHelpers.assertFieldValue(field, defaultFieldValue); + assertFieldValue(field, defaultFieldValue); }; /** * Asserts that the field properties are correct based on the test case. @@ -61,14 +63,14 @@ suite('Text Input Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue(field, testCase.expectedValue); + assertFieldValue(field, testCase.expectedValue); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldTextInput, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldTextInput, validValueTestCases, invalidValueTestCases, validTestCaseAssertField, assertFieldDefault); @@ -77,12 +79,12 @@ suite('Text Input Fields', function() { setup(function() { this.field = new Blockly.FieldTextInput(); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, defaultFieldValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('value'); - testHelpers.assertFieldValue(this.field, 'value'); + assertFieldValue(this.field, 'value'); }); }); suite('Value -> New Value', function() { @@ -90,12 +92,12 @@ suite('Text Input Fields', function() { setup(function() { this.field = new Blockly.FieldTextInput(initialValue); }); - testHelpers.runSetValueTests( + runSetValueTests( validValueTestCases, invalidValueTestCases, initialValue); test('With source block', function() { this.field.setSourceBlock(createTestBlock()); this.field.setValue('value'); - testHelpers.assertFieldValue(this.field, 'value'); + assertFieldValue(this.field, 'value'); }); }); }); @@ -136,12 +138,12 @@ suite('Text Input Fields', function() { this.field.isBeingEdited_ = true; this.field.htmlInput_.value = suiteInfo.value; this.field.onHtmlInputChange_(null); - testHelpers.assertFieldValue( + assertFieldValue( this.field, suiteInfo.expectedValue, suiteInfo.value); }); test('When Not Editing', function() { this.field.setValue(suiteInfo.value); - testHelpers.assertFieldValue(this.field, suiteInfo.expectedValue); + assertFieldValue(this.field, suiteInfo.expectedValue); }); }); }); diff --git a/tests/mocha/field_variable_test.js b/tests/mocha/field_variable_test.js index 4a93ccf41..2eafb6f42 100644 --- a/tests/mocha/field_variable_test.js +++ b/tests/mocha/field_variable_test.js @@ -6,7 +6,9 @@ goog.module('Blockly.test.fieldVariable'); -const {createGenUidStubWithReturns, createTestBlock, defineRowBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); +const {assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests} = goog.require('Blockly.test.helpers.fields'); +const {createGenUidStubWithReturns, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {createTestBlock, defineRowBlock} = goog.require('Blockly.test.helpers.blockDefinitions'); suite('Variable Fields', function() { @@ -83,7 +85,7 @@ suite('Variable Fields', function() { * @param {!Blockly.FieldVariable} field The field to check. */ const assertFieldDefault = function(field) { - testHelpers.assertFieldValue(field, FAKE_ID, defaultFieldName); + assertFieldValue(field, FAKE_ID, defaultFieldName); }; /** * Asserts that the field properties are correct based on the test case. @@ -91,15 +93,15 @@ suite('Variable Fields', function() { * @param {!FieldValueTestCase} testCase The test case. */ const validTestCaseAssertField = function(field, testCase) { - testHelpers.assertFieldValue(field, FAKE_ID, testCase.expectedText); + assertFieldValue(field, FAKE_ID, testCase.expectedText); }; - testHelpers.runConstructorSuiteTests( + runConstructorSuiteTests( Blockly.FieldVariable, validValueCreationTestCases, invalidValueCreationTestCases, validTestCaseAssertField, assertFieldDefault, customCreateWithJs); - testHelpers.runFromJsonSuiteTests( + runFromJsonSuiteTests( Blockly.FieldVariable, validValueCreationTestCases, invalidValueCreationTestCases, validTestCaseAssertField, assertFieldDefault, customCreateWithJson); @@ -149,7 +151,7 @@ suite('Variable Fields', function() { teardown(function() { console.warn = this.nativeConsoleWarn; }); - testHelpers.runSetValueTests(validValueTestCases, invalidValueTestCases, + runSetValueTests(validValueTestCases, invalidValueTestCases, FAKE_ID, defaultFieldName); }); @@ -215,7 +217,7 @@ suite('Variable Fields', function() { }); test('New Value', function() { this.variableField.setValue('id2'); - testHelpers.assertFieldValue(this.variableField, 'id1', 'name1'); + assertFieldValue(this.variableField, 'id1', 'name1'); }); }); suite('Force \'id\' ID Validator', function() { @@ -228,7 +230,7 @@ suite('Variable Fields', function() { // Must create the var so that the field doesn't throw an error. this.workspace.createVariable('thing2', null, 'other2'); this.variableField.setValue('other2'); - testHelpers.assertFieldValue(this.variableField, 'id2', 'name2'); + assertFieldValue(this.variableField, 'id2', 'name2'); }); }); suite('Returns Undefined Validator', function() { @@ -237,7 +239,7 @@ suite('Variable Fields', function() { }); test('New Value', function() { this.variableField.setValue('id2'); - testHelpers.assertFieldValue(this.variableField, 'id2', 'name2'); + assertFieldValue(this.variableField, 'id2', 'name2'); }); }); }); diff --git a/tests/mocha/flyout_test.js b/tests/mocha/flyout_test.js index 8f3e56693..8fbc38659 100644 --- a/tests/mocha/flyout_test.js +++ b/tests/mocha/flyout_test.js @@ -6,8 +6,8 @@ goog.module('Blockly.test.flyout'); -const {defineStackBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers'); -const {getBasicToolbox, getChildItem, getCollapsibleItem, getDeeplyNestedJSON, getInjectedToolbox, getNonCollapsibleItem, getProperSimpleJson, getSeparator, getSimpleJson, getXmlArray} = goog.require('Blockly.test.toolboxHelpers'); +const {defineStackBlock, sharedTestSetup, sharedTestTeardown, workspaceTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); +const {getBasicToolbox, getChildItem, getCollapsibleItem, getDeeplyNestedJSON, getInjectedToolbox, getNonCollapsibleItem, getProperSimpleJson, getSeparator, getSimpleJson, getXmlArray} = goog.require('Blockly.test.helpers.toolboxDefinitions'); suite('Flyout', function() { diff --git a/tests/mocha/generator_test.js b/tests/mocha/generator_test.js index 2231263d2..4167d44f6 100644 --- a/tests/mocha/generator_test.js +++ b/tests/mocha/generator_test.js @@ -11,7 +11,7 @@ goog.require('Blockly.JavaScript'); goog.require('Blockly.Lua'); goog.require('Blockly.PHP'); goog.require('Blockly.Python'); -const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Generator', function() { diff --git a/tests/mocha/gesture_test.js b/tests/mocha/gesture_test.js index 16a6cadda..6e21287de 100644 --- a/tests/mocha/gesture_test.js +++ b/tests/mocha/gesture_test.js @@ -6,8 +6,11 @@ goog.module('Blockly.test.gesture'); +const {assertEventFired, assertEventNotFired} = goog.require('Blockly.test.helpers.events'); +const {defineBasicBlockWithField} = goog.require('Blockly.test.helpers.blockDefinitions'); +const {dispatchPointerEvent} = goog.require('Blockly.test.helpers.userInput'); const eventUtils = goog.require('Blockly.Events.utils'); -const {assertEventFired, assertEventNotFired, defineBasicBlockWithField, dispatchPointerEvent, sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers'); +const {sharedTestSetup, sharedTestTeardown} = goog.require('Blockly.test.helpers.setupTeardown'); suite('Gesture', function() { diff --git a/tests/mocha/index.html b/tests/mocha/index.html index 7d734de53..d4d403314 100644 --- a/tests/mocha/index.html +++ b/tests/mocha/index.html @@ -24,7 +24,6 @@ -