test: update mocha tests to use goog_module (#5440)

* Use goog.module in mocha tests

* Fix compiler warnings

* Make test helpers a module

* Name test modules Blockly.test.*

This is to be more consistent with how non-test modules are named.

Also remove top-level goog.require of TestHelpers (now
Blockly.test.helpers) since requiring a side-effect-less module does
nothing.

* Convert block_test.js and comment_test.js to goog.module syntax

* Address PR comments

* Goog modulify tests

* Goog modulify toolbox helpers

* Fixes imports and moves common tests from workspace_test.js to a helper file.

* Update test deps after rebase

Co-authored-by: Christopher Allen <cpcallen+git@google.com>
This commit is contained in:
alschmiedt
2021-09-16 13:00:38 -07:00
committed by GitHub
parent 51d9dad31f
commit 5b1586ee1b
63 changed files with 2284 additions and 1671 deletions

View File

@@ -337,13 +337,25 @@ function buildDeps(done) {
const closurePath = argv.closureLibrary ?
'node_modules/google-closure-library/closure/goog' :
'closure/goog';
const roots = [
closurePath,
'core',
'blocks',
];
const testRoots = [
...roots,
'generators',
'tests/mocha'
];
const args = roots.map(root => `--root '${root}' `).join('');
execSync(`closure-make-deps ${args} > tests/deps.js`, {stdio: 'inherit'});
const testArgs = testRoots.map(root => `--root '${root}' `).join('');
execSync(`closure-make-deps ${testArgs} > tests/deps.mocha.js`,
{stdio: 'inherit'});
done();
};