Skip to content

Commit 50f2de6

Browse files
committed
feat: add ability to pass spawn opts
1 parent 133304a commit 50f2de6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/pure.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ async function render(
1818
args: string[] = [],
1919
opts: Partial<RenderOptions> = {},
2020
): Promise<RenderResult> {
21-
const {cwd = __dirname} = opts
21+
const {cwd = __dirname, spawnOpts = {}} = opts
2222

23+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
2324
const exec = childProcess.spawn(command, args, {
25+
...spawnOpts,
2426
cwd,
2527
shell: true,
2628
})

types/pure.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {
55
} from '@testing-library/dom'
66

77
import {getFireEventForElement} from "./events";
8+
import {SpawnOptionsWithoutStdio} from "child_process";
89

910
export interface TestInstance {
1011
cleanup(): void
@@ -18,7 +19,8 @@ export interface TestInstance {
1819

1920
export interface RenderOptions {
2021
cwd: string,
21-
debug: boolean
22+
debug: boolean,
23+
spawnOpts: Omit<SpawnOptionsWithoutStdio, 'cwd'>
2224
}
2325

2426
export type RenderResult = TestInstance & {

0 commit comments

Comments
 (0)