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