Commit Graph

9 Commits

Author SHA1 Message Date
Christopher Allen
7d29a3f9bb refactor(tests): Remove special handling of msg/messages.js 2022-06-14 23:35:46 +01:00
Christopher Allen
4911c066b3 feat(tests): Support an additionalScripts option
This is a list of scripts to load (in order) once the required modules
have been bootstrapped.

We do this using goog.addDependency to make the first script depend
on the required modules, then each subsequent script depend on the
previous one, and then finally goog.bootstrapping the last such script.
2022-06-14 23:35:45 +01:00
Christopher Allen
c55b30d3bb feat(tests): Use a proper quote function
We need to generate string literals.  Best to use a quote function
instead of concatenating on quote marks withou escaping.  Copy a
well-tested one from Code City.
2022-06-14 23:33:54 +01:00
Christopher Allen
b021e0da2f feat(tests): Make bootstrap.js more configurable.
* Terminology change: use "compressed" and "uncompressed" to describe
  what Closure Compiler calls "compiled" and "uncompiled", to reduce
  confusion with the compilation that will be done by tsc.

* Get the list of modules to bootstrap (in compressed mode), or
  scripts to load (in compressed mode) from BLOCKLY_BOOTSTRAP_OPTIONS,
  to allow calling scripts to to specify exactly what to load.
2022-06-14 23:33:49 +01:00
Christopher Allen
f3861563b7 fix(tests): Throw error if attempting to bootstrap in node.js 2022-06-14 23:33:48 +01:00
Christopher Allen
de776f5629 fix(tests): Don't use template literals in bootstrap.js
This is necessary (but not necessarily sufficient) to be able to
load the file in IE 11.
2022-06-14 23:33:48 +01:00
Christopher Allen
3b45606f92 fix(tests): Use the blockly repository path for all script src= URLs
Previously the (non-advanced) playground was only correctly loadging
on localhost because you can put an arbitrary number of "../"s in front
of a relative URL and it just takes you to the root directory.
2022-06-14 23:33:48 +01:00
Christopher Allen
74d6be111c feat(tests): Introduce BLOCKLY_BOOTSTRAP_OPTIONS
Provide a mechanism for web pages that use bootstrap.js to control
what is loaded and how.
2022-06-14 23:33:48 +01:00
Christopher Allen
dc16094551 refactor(tests): Move and rename prepare.js, blockly.mjs
Since prepare.js and blockly.mjs are going to be needed for running
all tests in uncompiled mode (not just the playgrounds), move them
tests/.  Further, rename prepare.js to bootstrap.js to better reflect
its purpose.
2022-06-14 23:33:39 +01:00