From 9910ffb114a648be247eabfcf193810f9f3fc14b Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Tue, 23 Nov 2021 13:58:31 -0500 Subject: [PATCH] Add a bundling step for tests This would change (done for all packages, and probably better), but added now to make running the tests easier for others. --- Gulpfile.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Gulpfile.js b/Gulpfile.js index fbfa49daea24c..79f4273715cca 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -18,8 +18,9 @@ const { buildProject, cleanProject, watchProject } = require("./scripts/build/pr const cmdLineOptions = require("./scripts/build/options"); const copyright = "CopyrightNotice.txt"; -const testRoot = "built/local/testRunner/Harness.js" -//!!! const testRoot = "built/local/run.js" +const testRootFile = "built/local/testRunner/Harness.js"; +const testRootBundle = "built/local/run.js"; +const testRoot = testRootBundle; // use testRootFile to run directly from the module files const cleanTasks = []; const buildScripts = () => buildProject("scripts"); @@ -322,7 +323,14 @@ task("watch-lssl").flags = { " --built": "Compile using the built version of the compiler." }; -const buildTests = () => buildProject("src/testRunner"); +const buildTests = series( + () => buildProject("src/testRunner"), + () => exec("npx", [ + "esbuild", "--bundle", "--format=cjs", "--platform=node", "--target=node12", + "--legal-comments=none", + `--outfile=${testRootBundle}`, testRootFile, + ]), +); task("tests", series(preBuild, parallel(buildLssl, buildTests))); task("tests").description = "Builds the test infrastructure"; task("tests").flags = {