setup-hugo/__tests__/os.test.ts
Peter Kurfer 2fc1d51eb6
Some checks failed
Continuous Integration / TypeScript Tests (push) Failing after 38s
Continuous Integration / GitHub Actions Test (push) Failing after 7s
Check Transpiled JavaScript / Check dist/ (push) Successful in 1m29s
feat: initial version
2024-05-02 18:38:23 +02:00

23 lines
558 B
TypeScript

import { Platform } from '../src/os'
beforeEach(() => {
jest.resetModules()
})
describe('Platform', () => {
test('getHomeDir - should return non-empty string', () => {
const homeDir = new Platform('linux', undefined, {
HOME: '/home/prskr'
}).getHomeDir()
expect(homeDir).toBe('/home/prskr')
})
test('getHomeDir - return USERPROFILE for win32 platform', () => {
const homeDir = new Platform('win32', undefined, {
USERPROFILE: 'C:\\Users\\prskr'
}).getHomeDir()
expect(homeDir).toBe('C:\\Users\\prskr')
})
})