support different working directory (#64)

* support different working directory

* validate working_directory
This commit is contained in:
Naoki Oketani
2020-05-23 15:59:51 +09:00
committed by GitHub
parent 277fc872da
commit 5209022168
8 changed files with 444 additions and 0 deletions

11
__tests__/workdir.test.ts Normal file
View 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()
})
})