Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
indexObj.query = testPageQuery;
// https://github.com/nodejs/node/issues/9500
for (let [ key, value ] of Object.entries(indexObj.query)) {
if ([ null, undefined, '' ].includes(value)) {
indexObj.query[key] = 'true';
}
}
// Set this so the script in shim-test-head.js can expose it to testem
indexObj.query.testemId = id;
let testUrl = url.format(indexObj);
// Start electron
let { pid } = await api.start({
dir: path.join(process.cwd(), electronProjectPath),
appPath: './tests',
args: [
'--', // needed because https://github.com/electron/electron/pull/13039
testUrl,
testemUrl,
],
});
// Clean up when we're killed
process.on('SIGTERM', () => {
treeKill(pid);
});
}