Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const test = async function() {
console.log('Starting Geckodriver...');
geckodriver.start();
console.log('Running functional tests...');
try {
childProcess.execFileSync(
'poetry', ['run', 'pytest'],
{cwd: FUNC_TEST_PATH, stdio: 'inherit'},
);
} finally {
console.log('Stopping Geckodriver...');
geckodriver.stop();
}
};
const startBrowser = () => {
switch (TARGET_BROWSER) {
case 'chrome':
chromedriver.start();
return () => chromedriver.stop();
case 'firefox':
geckodriver.start();
return () => geckodriver.stop();
default:
throw new Error(`${TARGET_BROWSER} browser driver is not configured`);
}
};