feat: Add getOS()
This commit is contained in:
parent
4b6109cfb2
commit
86eb62d73e
5 changed files with 35 additions and 26 deletions
17
__tests__/get-os.test.js
Normal file
17
__tests__/get-os.test.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
const getOS = require("../lib/get-os");
|
||||
|
||||
describe("getOS", () => {
|
||||
test("test", () => {
|
||||
expect(getOS("linux")).toBe("Linux");
|
||||
expect(getOS("darwin")).toBe("macOS");
|
||||
});
|
||||
|
||||
test("test exception", () => {
|
||||
expect(() => {
|
||||
getOS("win32");
|
||||
}).toThrowError("Windows is not supported");
|
||||
expect(() => {
|
||||
getOS("centos");
|
||||
}).toThrowError("centos is not supported");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue