Skip to content

Commit 696c616

Browse files
committed
Add a bundling step for tests
This will change (should be done for all packages, and probably better), but added now to make running the tests easier for others.
1 parent d6c537e commit 696c616

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Gulpfile.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ const { buildProject, cleanProject, watchProject } = require("./scripts/build/pr
1818
const cmdLineOptions = require("./scripts/build/options");
1919

2020
const copyright = "CopyrightNotice.txt";
21-
const testRoot = "built/local/testRunner/Harness.js";
22-
//!!! const testRoot = "built/local/run.js";
21+
const testRootFile = "built/local/testRunner/Harness.js";
22+
const testRootBundle = "built/local/run.js";
23+
const testRoot = testRootBundle; // use testRootFile to run directly from the module files
2324
const cleanTasks = [];
2425

2526
const buildScripts = () => buildProject("scripts");
@@ -322,7 +323,14 @@ task("watch-lssl").flags = {
322323
" --built": "Compile using the built version of the compiler."
323324
};
324325

325-
const buildTests = () => buildProject("src/testRunner");
326+
const buildTests = series(
327+
() => buildProject("src/testRunner"),
328+
() => exec("npx", [
329+
"esbuild", "--bundle", "--format=cjs", "--platform=node", "--target=node12",
330+
"--legal-comments=none",
331+
`--outfile=${testRootBundle}`, testRootFile,
332+
]),
333+
);
326334
task("tests", series(preBuild, parallel(buildLssl, buildTests)));
327335
task("tests").description = "Builds the test infrastructure";
328336
task("tests").flags = {

0 commit comments

Comments
 (0)