You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to do Electron renderer tests with Tape, for an app which (joy of joys) I'm mostly building on Windows. I ran into a couple of problems which I've managed to work around, but might be worth fixing properly:
The special case in default_stream.js where fs.writeSync is used instead of console.log meant I initially had no output at all, because although fs.writeSync is technically supported in the Electron browser, apparently you can't reliably write to stdout with it. My workaround was to use a custom stream which is basically a copy of the default one with that special case removed.
Because Electron exposes a process object to the renderer, Tape assumes that process.on('exit') can be used to write the overall test results. Unfortunately it looks like this event also can't be relied on in the Electron browser, so I had to work around it by creating a harness with autoclose explicitly set to true.
The electron renderer is clearly an odd special case because it's not really a Node.js environment or a plain old browser. Still, it would be great if those sorts of things just worked by default rather than requiring this kind of workaround!
The text was updated successfully, but these errors were encountered:
Hi,
I've been trying to do Electron renderer tests with Tape, for an app which (joy of joys) I'm mostly building on Windows. I ran into a couple of problems which I've managed to work around, but might be worth fixing properly:
default_stream.js
wherefs.writeSync
is used instead ofconsole.log
meant I initially had no output at all, because althoughfs.writeSync
is technically supported in the Electron browser, apparently you can't reliably write to stdout with it. My workaround was to use a custom stream which is basically a copy of the default one with that special case removed.process
object to the renderer, Tape assumes thatprocess.on('exit')
can be used to write the overall test results. Unfortunately it looks like this event also can't be relied on in the Electron browser, so I had to work around it by creating a harness withautoclose
explicitly set to true.The electron renderer is clearly an odd special case because it's not really a Node.js environment or a plain old browser. Still, it would be great if those sorts of things just worked by default rather than requiring this kind of workaround!
The text was updated successfully, but these errors were encountered: