Files
blockly/tests/mocha/test_helpers/variables.js
Beka Westberg 01d45972d4 fix: revert converting test helpers to es modules (#5982)
* Revert "fix: lint"

This reverts commit 050956d105.

* Revert "fix: run mocha as a module"

This reverts commit 4dac25ae99.

* Revert "move to modules, but break mocha"

This reverts commit 220d7bbd1d.
2022-03-09 07:38:37 -08:00

26 lines
831 B
JavaScript

/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
goog.module('Blockly.test.helpers.variables');
/**
* Check if a variable with the given values exists.
* @param {Blockly.Workspace|Blockly.VariableMap} container The workspace or
* variableMap the checked variable belongs to.
* @param {!string} name The expected name of the variable.
* @param {!string} type The expected type of the variable.
* @param {!string} id The expected id of the variable.
*/
function assertVariableValues(container, name, type, id) {
const variable = container.getVariableById(id);
chai.assert.isDefined(variable);
chai.assert.equal(variable.name, name);
chai.assert.equal(variable.type, type);
chai.assert.equal(variable.getId(), id);
}
exports.assertVariableValues = assertVariableValues;