Skip to content

Commit a92ba99

Browse files
committed
add docstring to testUtil
1 parent 4a55e56 commit a92ba99

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/src/test/testUtil.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,11 @@ function setPath(newPath: string): void {
622622
function readPath(): string {
623623
return process.env.PATH || ''
624624
}
625-
625+
/**
626+
* Overwrite the $PATH environment variable for the span of the provided task, then reset it.
627+
* @param newPath temporary $PATH value
628+
* @param task work to be done with $PATH set.
629+
*/
626630
export async function withEnvPath(newPath: string, task: () => Promise<void>): Promise<void | never> {
627631
const originalPath = readPath()
628632
setPath(newPath)

0 commit comments

Comments
 (0)