Skip to content

Commit bcd1f45

Browse files
committed
test(windows): allow jet to work on windows
- nyc does not work on windows, so skip coverage - node needs to spawn in a subshell on windows to have PATH correct
1 parent 8a9f786 commit bcd1f45

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/e2e/firebase.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,17 @@ describe('Jet Tests', function () {
2323
it('runs all tests', async function () {
2424
return new Promise(async (resolve, reject) => {
2525
const platform = detox.device.getPlatform();
26-
const jetProcess = spawn('yarn', ['jet', `--target=${platform}`, '--coverage'], {
26+
const jetArgs =
27+
process.platform === 'win32'
28+
? ['jet', `--target=${platform}`] // NYC / coverage does not work on windows.
29+
: ['jet', `--target=${platform}`, '--coverage'];
30+
const jetProcess = spawn('yarn', jetArgs, {
2731
stdio: ['ignore', 'inherit', 'inherit'],
32+
shell: true,
33+
});
34+
jetProcess.on('error', err => {
35+
console.error(`Jet tests had an error: ${err}`);
36+
reject(new Error(`Jet tests failed!`));
2837
});
2938
jetProcess.on('close', code => {
3039
if (code === 0) {

0 commit comments

Comments
 (0)