2019-09-21 01:41:21 +00:00
|
|
|
import getOS from '../src/get-os';
|
|
|
|
|
|
|
|
describe('getOS', () => {
|
2020-10-12 06:26:57 +00:00
|
|
|
test('os type', () => {
|
2019-09-21 01:41:21 +00:00
|
|
|
expect(getOS('linux')).toBe('Linux');
|
|
|
|
expect(getOS('darwin')).toBe('macOS');
|
|
|
|
expect(getOS('win32')).toBe('Windows');
|
|
|
|
});
|
|
|
|
|
2020-10-12 06:26:57 +00:00
|
|
|
test('exception', () => {
|
2019-09-21 01:41:21 +00:00
|
|
|
expect(() => {
|
|
|
|
getOS('centos');
|
|
|
|
}).toThrowError('centos is not supported');
|
|
|
|
});
|
|
|
|
});
|