strapi/test/cypress.js

26 lines
570 B
JavaScript
Raw Normal View History

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)
.then(results => {
if (results.totalFailed > 0) {
2019-03-12 11:58:30 +01:00
return process.stdout.write('Cypress tests finished with errors\n', () => {
process.exit(1);
});
}
2019-03-11 10:42:43 +01:00
process.exit(0);
})
.catch(err => {
console.error(err);
process.stdout.write('Error running cypress', () => {
process.exit(1);
});
2019-03-11 10:42:43 +01:00
});