From 302385e6711e4ae5212a95a78e85734341c8851a Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Wed, 18 Sep 2019 10:39:24 +0900 Subject: [PATCH] gha: Add testing for windows-2019 --- .github/workflows/test.yml | 2 +- __tests__/get-os.test.js | 7 ++++--- lib/get-os.js | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7bd61e4..41162f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: needs: test strategy: matrix: - os: ['ubuntu-18.04', 'macOS-10.14'] + os: ['ubuntu-18.04', 'macOS-10.14', 'windows-2019'] hugo-version: ['latest'] extended: [true] # hugo-version: ['latest', '0.58.2'] diff --git a/__tests__/get-os.test.js b/__tests__/get-os.test.js index 3254a98..c278d84 100644 --- a/__tests__/get-os.test.js +++ b/__tests__/get-os.test.js @@ -4,12 +4,13 @@ describe("getOS", () => { test("test", () => { expect(getOS("linux")).toBe("Linux"); expect(getOS("darwin")).toBe("macOS"); + expect(getOS("win32")).toBe("Windows"); }); test("test exception", () => { - expect(() => { - getOS("win32"); - }).toThrowError("Windows is not supported"); + // expect(() => { + // getOS("win32"); + // }).toThrowError("Windows is not supported"); expect(() => { getOS("centos"); }).toThrowError("centos is not supported"); diff --git a/lib/get-os.js b/lib/get-os.js index bd076c3..3fa37a4 100644 --- a/lib/get-os.js +++ b/lib/get-os.js @@ -4,7 +4,8 @@ function getOS(platform) { } else if (platform === "darwin") { return "macOS"; } else if (platform === "win32") { - throw new Error("Windows is not supported"); + return "Windows"; + // throw new Error("Windows is not supported"); } else { throw new Error(`${platform} is not supported`); }