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