var shell = require('shelljs')
shell.exec('ava test/**/*.js --color=always')
@@ -28,49 +28,275 @@
 s')%0A
-shell.exec('ava test/**/*.js --color=always')
+%0Aif(process.env.CI !== 'true' && shell.exec('npm run build').code != 0)%7B%0A  shell.echo('Error: Project failed to build.');%0A  shell.exit(1);%0A%7D%0A%0Aif(shell.exec('ava test/**/*.js --color=always').code != 0)%7B%0A  shell.echo('Error: One or more tests failed.');%0A  shell.exit(1);%0A%7D

Correct output of shell errors for CI detection