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
|
||||
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']
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue