fix: Fix the compiler test, and check if it worked. (#6638)

* Add tsick.js to rewrite enums.

tsc generates JavaScript which is incompatible with the Closure Compiler's advanced optimizations.

* Remove unused 'outputCode' variable.

* Rename 'run_X_in_browser.js' to 'webdriver.js'

The Mocha and generator tests can both be run either manually or via our webdriver.  In all cases they run in a browser.  These two 'run_X_in_browser.js' files only apply to webdriver, thus they are confusingly named.

Also delete completely unused (and broken) `run_all_tests.sh`

* Linting improvements to mocha/webdriver.js

Still not at 100%.  Complains about require/module/process/__dirname not being defined in multiple places.

* runTestBlock -> runTestFunction

'Block' means something very different in Blockly.

* Removal of `var` from scripts.

* Add webdriver test to verify compile test worked.

* Resolve conficts with 'develop'.

* Address PR comments.
This commit is contained in:
Neil Fraser
2022-11-25 20:45:00 +01:00
committed by GitHub
parent be4b8323c5
commit 5a64a9a7f7
14 changed files with 349 additions and 154 deletions

View File

@@ -8,16 +8,16 @@
* @fileoverview Gulp script to deploy Blockly demos on appengine.
*/
var gulp = require('gulp');
const gulp = require('gulp');
var fs = require('fs');
var rimraf = require('rimraf');
var path = require('path');
var execSync = require('child_process').execSync;
const fs = require('fs');
const rimraf = require('rimraf');
const path = require('path');
const execSync = require('child_process').execSync;
const buildTasks = require('./build_tasks.js');
const packageTasks = require('./package_tasks.js');
var packageJson = require('../../package.json');
const packageJson = require('../../package.json');
const demoTmpDir = '../_deploy';
const demoStaticTmpDir = '../_deploy/static';
@@ -121,10 +121,10 @@ function deployAndClean(done) {
* Constructs a beta demo version name based on the current date.
*/
function getDemosBetaVersion() {
var date = new Date();
var mm = date.getMonth() + 1; // Month, 0-11
var dd = date.getDate(); // Day of the month, 1-31
var yyyy = date.getFullYear();
const date = new Date();
const mm = date.getMonth() + 1; // Month, 0-11
const dd = date.getDate(); // Day of the month, 1-31
const yyyy = date.getFullYear();
return `${yyyy}${mm < 10 ? '0' + mm : mm}${dd}-beta`;
}
@@ -140,7 +140,7 @@ function deployBetaAndClean(done) {
/**
* Prepares demos.
*
*
* Prerequisites (invoked): clean, build
*/
const prepareDemos = gulp.series(