peaceiris/actions-hugo

View on GitHub
__tests__/get-os.test.ts

Summary

Maintainability
B
4 hrs
Test Coverage
import getOS from '../src/get-os';
 
Similar blocks of code found in 2 locations. Consider refactoring.
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');
});
});