15 lines
352 B
TypeScript
15 lines
352 B
TypeScript
import getOS from '../src/get-os';
|
|
|
|
describe('getOS', () => {
|
|
test('os type', () => {
|
|
expect(getOS('linux')).toBe('Linux');
|
|
expect(getOS('darwin')).toBe('macOS');
|
|
expect(getOS('win32')).toBe('Windows');
|
|
});
|
|
|
|
test('exception', () => {
|
|
expect(() => {
|
|
getOS('centos');
|
|
}).toThrowError('centos is not supported');
|
|
});
|
|
});
|