2019-03-11 10:42:43 +01:00
|
|
|
const cypress = require('cypress');
|
|
|
|
|
|
|
|
const config = Object.assign(
|
|
|
|
{
|
|
|
|
spec: './packages/**/test/front/integration/*',
|
|
|
|
},
|
|
|
|
process.env.npm_config_browser === 'true' ? { browser: 'chrome' } : {}
|
|
|
|
);
|
|
|
|
|
|
|
|
cypress
|
|
|
|
.run(config)
|
2019-03-12 11:41:38 +01:00
|
|
|
.then(results => {
|
|
|
|
if (results.totalFailed > 0) {
|
2019-03-12 11:58:30 +01:00
|
|
|
return process.stdout.write('Cypress tests finished with errors\n', () => {
|
2019-03-12 11:41:38 +01:00
|
|
|
process.exit(1);
|
|
|
|
});
|
|
|
|
}
|
2019-03-11 10:42:43 +01:00
|
|
|
process.exit(0);
|
|
|
|
})
|
|
|
|
.catch(err => {
|
|
|
|
console.error(err);
|
2019-03-12 11:41:38 +01:00
|
|
|
process.stdout.write('Error running cypress', () => {
|
|
|
|
process.exit(1);
|
|
|
|
});
|
2019-03-11 10:42:43 +01:00
|
|
|
});
|