Skip to content

Commit

Permalink
Add a bundling step for tests
Browse files Browse the repository at this point in the history
This will change (should be done for all packages, and probably better),
but added now to make running the tests easier for others.
  • Loading branch information
elibarzilay committed Jan 11, 2022
1 parent f144c35 commit 23ce87d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 23ce87d

Please sign in to comment.