2019-09-18 09:59:07 +09:00
|
|
|
const getOS = require("../lib/get-os");
|
|
|
|
|
|
|
|
|
|
describe("getOS", () => {
|
|
|
|
|
test("test", () => {
|
|
|
|
|
expect(getOS("linux")).toBe("Linux");
|
|
|
|
|
expect(getOS("darwin")).toBe("macOS");
|
2019-09-18 10:39:24 +09:00
|
|
|
expect(getOS("win32")).toBe("Windows");
|
2019-09-18 09:59:07 +09:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("test exception", () => {
|
2019-09-18 10:39:24 +09:00
|
|
|
// expect(() => {
|
|
|
|
|
// getOS("win32");
|
|
|
|
|
// }).toThrowError("Windows is not supported");
|
2019-09-18 09:59:07 +09:00
|
|
|
expect(() => {
|
|
|
|
|
getOS("centos");
|
|
|
|
|
}).toThrowError("centos is not supported");
|
|
|
|
|
});
|
|
|
|
|
});
|