Skip to content

Commit

Permalink
ci: add Windows CI tests (#2548)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Jul 14, 2024
1 parent 2e373b2 commit 07292a2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ on:
jobs:
test:
name: Node.js Tests
runs-on: ubuntu-latest
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
node: [16.x, 18.x, 20.x, 22.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
Expand Down
31 changes: 18 additions & 13 deletions test/build.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import assert from "assert";
import { type Scenario, mapDirectory, runScenarios } from "./scenarios";

const filesOwnName = await mapDirectory("test/fixtures/scenario_build_app");
// Windows tests are disabled
if (process.platform !== 'win32') {

const scenarios: Scenario[] = [
{
files: filesOwnName,
commands: ["jspm build --config rollup-config.mjs"],
validationFn: async (files) => {
const build = files.get("build.js");
assert(!!build);
assert(!build.includes('import { add } from "./utils.js"'));
assert(build.includes("const add = (num1, num2) => num1 + num2"));
const filesOwnName = await mapDirectory("test/fixtures/scenario_build_app");

const scenarios: Scenario[] = [
{
files: filesOwnName,
commands: ["jspm build --config rollup-config.mjs"],
validationFn: async (files) => {
const build = files.get("build.js");
assert(!!build);
assert(!build.includes('import { add } from "./utils.js"'));
assert(build.includes("const add = (num1, num2) => num1 + num2"));
},
},
},
];
];

runScenarios(scenarios);

runScenarios(scenarios);
}

0 comments on commit 07292a2

Please sign in to comment.