Skip to content

Commit

Permalink
Use 'verbose' listr renderer in CI (#466)
Browse files Browse the repository at this point in the history
* Use 'verbose' listr renderer in CI (fixes #465)

* skip coverage report on integration test

* print stderr
  • Loading branch information
futpib authored and sindresorhus committed Dec 2, 2019
1 parent bb53614 commit f45bd57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -16,4 +16,4 @@ script:
- if [[ $LINT == true ]]; then npm run lint; fi
- if [[ $SKIP_TEST != true ]]; then npm test; fi
after_success:
- if [[ $LINT != true ]]; then ./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls; fi
- if [[ $SKIP_TEST != true ]]; then ./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls; fi
15 changes: 13 additions & 2 deletions test/integration/test.js
Expand Up @@ -6,6 +6,7 @@ const tempy = require('tempy');
const execa = require('execa');
const del = require('del');
const chalk = require('chalk');
const {isCI} = require('ci-info');

const packages = new Map([
['ava', 'https://github.com/avajs/ava'],
Expand Down Expand Up @@ -130,7 +131,10 @@ const execute = name => {
title: 'Clean up',
task: () => del(destination, {force: true})
}
], {
].map(({title, ...task}) => ({
title: [name, title].join(' / '),
...task
})), {
exitOnError: false
});
};
Expand All @@ -157,14 +161,21 @@ const list = new Listr([
return tests;
}
}
]);
], {
renderer: isCI ? 'verbose' : 'default'
});

list.run()
.catch(error => {
if (error.errors) {
for (const error2 of error.errors) {
console.error('\n', chalk.red.bold.underline(error2.packageName), chalk.gray('(' + error2.cliArgs.join(' ') + ')'));
console.error(error2.message);

if (error2.stderr) {
console.error(chalk.gray(error2.stderr));
}

if (error2.eslintMessage) {
console.error(chalk.gray(error2.eslintFile.filePath), chalk.gray(JSON.stringify(error2.eslintMessage, null, 2)));
}
Expand Down

0 comments on commit f45bd57

Please sign in to comment.