gha: Add testing for windows-2019
This commit is contained in:
parent
724bfcf9f3
commit
302385e671
3 changed files with 7 additions and 5 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -27,7 +27,7 @@ jobs:
|
||||||
needs: test
|
needs: test
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: ['ubuntu-18.04', 'macOS-10.14']
|
os: ['ubuntu-18.04', 'macOS-10.14', 'windows-2019']
|
||||||
hugo-version: ['latest']
|
hugo-version: ['latest']
|
||||||
extended: [true]
|
extended: [true]
|
||||||
# hugo-version: ['latest', '0.58.2']
|
# hugo-version: ['latest', '0.58.2']
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,13 @@ describe("getOS", () => {
|
||||||
test("test", () => {
|
test("test", () => {
|
||||||
expect(getOS("linux")).toBe("Linux");
|
expect(getOS("linux")).toBe("Linux");
|
||||||
expect(getOS("darwin")).toBe("macOS");
|
expect(getOS("darwin")).toBe("macOS");
|
||||||
|
expect(getOS("win32")).toBe("Windows");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("test exception", () => {
|
test("test exception", () => {
|
||||||
expect(() => {
|
// expect(() => {
|
||||||
getOS("win32");
|
// getOS("win32");
|
||||||
}).toThrowError("Windows is not supported");
|
// }).toThrowError("Windows is not supported");
|
||||||
expect(() => {
|
expect(() => {
|
||||||
getOS("centos");
|
getOS("centos");
|
||||||
}).toThrowError("centos is not supported");
|
}).toThrowError("centos is not supported");
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ function getOS(platform) {
|
||||||
} else if (platform === "darwin") {
|
} else if (platform === "darwin") {
|
||||||
return "macOS";
|
return "macOS";
|
||||||
} else if (platform === "win32") {
|
} else if (platform === "win32") {
|
||||||
throw new Error("Windows is not supported");
|
return "Windows";
|
||||||
|
// throw new Error("Windows is not supported");
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`${platform} is not supported`);
|
throw new Error(`${platform} is not supported`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue