test(sandbox): satisfy path boundary lint
This commit is contained in:
@@ -25,8 +25,12 @@ describe('Windows ACL temp path boundary', () => {
|
|||||||
const nested = join(workspace, 'temp')
|
const nested = join(workspace, 'temp')
|
||||||
mkdirSync(nested)
|
mkdirSync(nested)
|
||||||
|
|
||||||
expect(() => assertTempRootOutsideWorkspace(workspace, workspace)).toThrow(/temp root must be outside the workspace/u)
|
expect(() => {
|
||||||
expect(() => assertTempRootOutsideWorkspace(workspace, nested)).toThrow(/temp root must be outside the workspace/u)
|
assertTempRootOutsideWorkspace(workspace, workspace)
|
||||||
|
}).toThrow(/temp root must be outside the workspace/u)
|
||||||
|
expect(() => {
|
||||||
|
assertTempRootOutsideWorkspace(workspace, nested)
|
||||||
|
}).toThrow(/temp root must be outside the workspace/u)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('accepts a temp parent above the workspace because a fresh child is a sibling', () => {
|
it('accepts a temp parent above the workspace because a fresh child is a sibling', () => {
|
||||||
@@ -34,7 +38,9 @@ describe('Windows ACL temp path boundary', () => {
|
|||||||
const workspace = join(tempRoot, 'workspace')
|
const workspace = join(tempRoot, 'workspace')
|
||||||
mkdirSync(workspace)
|
mkdirSync(workspace)
|
||||||
|
|
||||||
expect(() => assertTempRootOutsideWorkspace(workspace, tempRoot)).not.toThrow()
|
expect(() => {
|
||||||
|
assertTempRootOutsideWorkspace(workspace, tempRoot)
|
||||||
|
}).not.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('requires an actual private temp directory to be disjoint in either direction', () => {
|
it('requires an actual private temp directory to be disjoint in either direction', () => {
|
||||||
@@ -46,8 +52,14 @@ describe('Windows ACL temp path boundary', () => {
|
|||||||
mkdirSync(nestedTemp)
|
mkdirSync(nestedTemp)
|
||||||
mkdirSync(siblingTemp)
|
mkdirSync(siblingTemp)
|
||||||
|
|
||||||
expect(() => assertPrivateTempDisjoint([workspace], nestedTemp)).toThrow(/must be disjoint/u)
|
expect(() => {
|
||||||
expect(() => assertPrivateTempDisjoint([nestedTemp], workspace)).toThrow(/must be disjoint/u)
|
assertPrivateTempDisjoint([workspace], nestedTemp)
|
||||||
expect(() => assertPrivateTempDisjoint([workspace], siblingTemp)).not.toThrow()
|
}).toThrow(/must be disjoint/u)
|
||||||
|
expect(() => {
|
||||||
|
assertPrivateTempDisjoint([nestedTemp], workspace)
|
||||||
|
}).toThrow(/must be disjoint/u)
|
||||||
|
expect(() => {
|
||||||
|
assertPrivateTempDisjoint([workspace], siblingTemp)
|
||||||
|
}).not.toThrow()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user