actions-hugo/__tests__/get-os.test.ts

19 lines
453 B
TypeScript
Raw Normal View History

2019-09-21 10:00:59 +09:00
import getOS from '../src/get-os';
2019-09-18 09:59:07 +09:00
2019-09-21 10:00:59 +09:00
describe('getOS', () => {
test('test', () => {
expect(getOS('linux')).toBe('Linux');
expect(getOS('darwin')).toBe('macOS');
expect(getOS('win32')).toBe('Windows');
2019-09-18 09:59:07 +09:00
});
2019-09-21 10:00:59 +09:00
test('test exception', () => {
2019-09-18 10:39:24 +09:00
// expect(() => {
// getOS("win32");
// }).toThrowError("Windows is not supported");
2019-09-18 09:59:07 +09:00
expect(() => {
2019-09-21 10:00:59 +09:00
getOS('centos');
}).toThrowError('centos is not supported');
2019-09-18 09:59:07 +09:00
});
});