Skip to content

Commit 3046a33

Browse files
committed
Fix renderer stdio in Electron 5
1 parent aad388b commit 3046a33

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

bin/electron-mocha

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ function run (electron) {
3535
...process.argv.slice(2)
3636
]
3737

38-
let child = spawn(electron, args, {
39-
stdio: 'inherit'
40-
})
38+
let child = spawn(electron, args)
39+
40+
// stdio 'inherit' not work reliably in Renderer!
41+
child.stdout.pipe(process.stdout)
42+
child.stderr.pipe(process.stderr)
43+
process.stdin.pipe(child.stdin)
4144

4245
child.on('exit', (code, signal) => {
4346
if (signal) {

test/mocha.opts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
--color
12
--require test/support/require
23
--require-main test/support/requireMain

0 commit comments

Comments
 (0)