feat: Migrate JavaScript to TypeScript
This commit is contained in:
parent
b3cddbe7fa
commit
7b1d8d3b9b
17 changed files with 585 additions and 142 deletions
18
__tests__/get-os.test.ts
Normal file
18
__tests__/get-os.test.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import getOS from "../src/get-os";
|
||||
|
||||
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("centos");
|
||||
}).toThrowError("centos is not supported");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue