From 07292a2b67c606d7915a050988113c2d32bc0676 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Mon, 15 Jul 2024 00:18:54 +0200 Subject: [PATCH] ci: add Windows CI tests (#2548) --- .github/workflows/ci.yml | 3 ++- test/build.test.ts | 31 ++++++++++++++++++------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aacfc42a..4c5c7cbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/test/build.test.ts b/test/build.test.ts index 91f93fc2..2cc5a30c 100644 --- a/test/build.test.ts +++ b/test/build.test.ts @@ -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); +} \ No newline at end of file