feat: initial version
This commit is contained in:
commit
2fc1d51eb6
37 changed files with 66401 additions and 0 deletions
__tests__
23
__tests__/os.test.ts
Normal file
23
__tests__/os.test.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
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')
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue