Skip to content

Commit

Permalink
fix(test): test:client silently failing on Travis (#3343)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
devoto13 authored and johnjbarton committed Jul 26, 2019
1 parent 094bcc6 commit 1489e9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/error.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -32,5 +32,5 @@ Feature: Error Display
When I runOut Karma
Then it fails with like:
"""
SyntaxError: Unexpected token }
SyntaxError: Unexpected token '}'
"""

0 comments on commit 1489e9a

Please sign in to comment.