gha: Add testing for windows-2019

This commit is contained in:
peaceiris 2019-09-18 10:39:24 +09:00
parent 724bfcf9f3
commit 302385e671
3 changed files with 7 additions and 5 deletions

View file

@ -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']

View file

@ -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");

View file

@ -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`);
}