support different working directory (#64)
* support different working directory * validate working_directory
This commit is contained in:
11
__tests__/workdir.test.ts
Normal file
11
__tests__/workdir.test.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as workdir from '../src/workdir'
|
||||
|
||||
describe('isValid', () => {
|
||||
test('throws an error if working_directory starts with /', () => {
|
||||
expect(workdir.isValid('/usr/local/bin')).toBeFalsy()
|
||||
})
|
||||
|
||||
test('throws an error if working_directory starts with ..', () => {
|
||||
expect(workdir.isValid('../../etc')).toBeFalsy()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user