Skip to content

Commit ba9fa6f

Browse files
committed
replace manual childprocess with tryRun
1 parent b57053d commit ba9fa6f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/core/src/test/shared/utilities/testUtils.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import assert from 'assert'
66
import { createExecutableFile, createTestWorkspaceFolder, envWithNewPath, readEnv, setEnv } from '../../testUtil'
77
import path from 'path'
8-
import { ChildProcess } from '../../../shared/utilities/processUtils'
98
import { fs } from '../../../shared'
109
import { isWin } from '../../../shared/vscode/env'
10+
import { tryRun } from '../../../shared/utilities/pathFind'
1111

1212
describe('envWithNewPath', function () {
1313
it('gives current path with new PATH', function () {
@@ -29,16 +29,13 @@ describe('writeEnv', function () {
2929
})
3030

3131
describe('createExecutableFile', function () {
32-
it('creates a file that can be executes in a child process', async function () {
32+
it('creates a file that can be executed', async function () {
3333
const tempDir = await createTestWorkspaceFolder()
3434
const filePath = path.join(tempDir.uri.fsPath, `exec${isWin() ? '.cmd' : ''}`)
3535
await createExecutableFile(filePath, '')
3636

37-
const proc = new ChildProcess(filePath)
38-
const result = await proc.run()
37+
const result = await tryRun(filePath, [], 'yes')
3938
assert.ok(result)
40-
assert.ok(result.exitCode === 0)
41-
4239
await fs.delete(tempDir.uri, { force: true, recursive: true })
4340
})
4441
})

0 commit comments

Comments
 (0)