From 1489e9a17f056567a10b40c0b689bc7565219d5a Mon Sep 17 00:00:00 2001 From: Yaroslav Admin Date: Fri, 26 Jul 2019 03:10:35 +0200 Subject: [PATCH] fix(test): `test:client` silently failing on Travis (#3343) * fix(test): ensure that grunt test:client exits with non-zero code Apparently it is not enough to check `code`, because when process crashes `code` is set to `null` and `err` is passed instead. Example of failing tests, which didn't fail build: https://travis-ci.org/karma-runner/karma/jobs/537027667#L1046 * fix(test): adjust assertions to work in latest Chrome --- tasks/test.js | 2 +- test/e2e/error.feature | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/test.js b/tasks/test.js index 373c3ba45..efbed1c15 100644 --- a/tasks/test.js +++ b/tasks/test.js @@ -26,7 +26,7 @@ module.exports = function (grunt) { function exec (args, failMsg) { spawnKarma(args, function (err, result, code) { - if (code) { + if (code || err) { console.error(err) grunt.fail.fatal(failMsg, code) } else { diff --git a/test/e2e/error.feature b/test/e2e/error.feature index df9c2ed94..1426266d2 100644 --- a/test/e2e/error.feature +++ b/test/e2e/error.feature @@ -16,7 +16,7 @@ Feature: Error Display When I start Karma Then it fails with: """ - SyntaxError: Unexpected token } + SyntaxError: Unexpected token '}' """ Scenario: Not single-run Syntax Error in a test file Given a configuration with: @@ -32,5 +32,5 @@ Feature: Error Display When I runOut Karma Then it fails with like: """ - SyntaxError: Unexpected token } + SyntaxError: Unexpected token '}' """