mirror of
https://github.com/google/blockly.git
synced 2026-01-12 11:27:14 +01:00
* Revert "fix: lint" This reverts commit050956d105. * Revert "fix: run mocha as a module" This reverts commit4dac25ae99. * Revert "move to modules, but break mocha" This reverts commit220d7bbd1d.
26 lines
831 B
JavaScript
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;
|