karma-growl-reporter icon indicating copy to clipboard operation
karma-growl-reporter copied to clipboard

No error message displayed when tests fail

Open ahutchings opened this issue 10 years ago • 0 comments

When running a suite of failing mocha tests, browser.lastResult.error is set to true, triggering a notification with an empty message. It looks like the growl reporter expects browser.lastResult.error to be false in this case, which would have correctly output a message indicating that tests failed.

growl-notification

The browser object passed to onBrowserComplete:

{
  "id": "81359499",
  "fullName": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36",
  "name": "Chrome 33.0.1750 (Windows 7)",
  "state": 1,
  "lastResult": {
    "success": 0,
    "failed": 1,
    "skipped": 0,
    "total": 1,
    "totalTime": 8,
    "netTime": NaN,
    "error": true,
    "disconnected": false,
    "totalTimeEnd": [Function],
    "add": [Function]
  },
  "disconnectsCount": 0,
  "init": [Function],
  "isReady": [Function],
  "toString": [Function],
  "onError": [Function],
  "onInfo": [Function],
  "onStart": [Function],
  "onComplete": [Function],
  "onDisconnect": [Function],
  "reconnect": [Function],
  "onResult": [Function],
  "serialize": [Function],
  "execute": [Function]
}

The progress reporter outputs the following:

$ karma start
INFO [karma]: Karma v0.11.14 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 33.0.1750 (Windows 7)]: Connected on socket NuRLtIjwCpdt9l57IuFN wi
th id 30019243
LOG: 'Woof!'
Chrome 33.0.1750 (Windows 7) Dog should bark FAILED
        expected 1 to equal 3
        AssertionError: expected 1 to equal 3
Chrome 33.0.1750 (Windows 7): Executed 1 of 1 (1 FAILED) ERROR (0.008 secs / NaN
 secs)

The issue can be reproduced with this setup: https://github.com/ahutchings/karma-test

Versions used are: node 0.10.26, karma 0.11.14, karma-growl-reporter 0.1.1

ahutchings avatar Feb 26 '14 03:02 ahutchings