• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pghalliday / mocha-sonar-reporter / 29 / 1
100%
master: 100%

Build:
DEFAULT BRANCH: master
Ran 29 Mar 2016 02:10PM UTC
Files 5
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Mar 2016 02:07PM UTC coverage: 100.0%. Remained the same
29.1

Pull #8

travis-ci

Yimgo
Fix TypeError when beforeEach throws

When an error was thrown in beforeEach (and probably before, after and afterEach
as well), Test.file is undefined and the following error is thrown by
mocha-report-sonar:

```
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.posix.relative (path.js:496:3)
    at extractClassName
(/node_modules/mocha-sonar-reporter/lib/Sonar.js:110:33)
    at test
(/node_modules/mocha-sonar-reporter/lib/Sonar.js:75:20)
    at Array.forEach (native)
    at Runner.<anonymous>
(/node_modules/mocha-sonar-reporter/lib/Sonar.js:65:11)
    at emitNone (events.js:72:20)
    at Runner.emit (events.js:166:7)
    at
(/node_modules/mocha/lib/runner.js:735:12
    at done
(/node_modules/mocha/lib/runner.js:619:7)
    at next
(/node_modules/mocha/lib/runner.js:586:16)
    at done
(/node_modules/mocha/lib/runner.js:619:7)
    at next
(/node_modules/mocha/lib/runner.js:590:14)
    at done
(/node_modules/mocha/lib/runner.js:619:7)
    at next
(/node_modules/mocha/lib/runner.js:590:14)
    at Runner.hookErr
(/node_modules/mocha/lib/runner.js:461:7)
    at Runner.uncaught
(/node_modules/mocha/lib/runner.js:696:19)
    at process.uncaught
(/node_modules/mocha/lib/runner.js:727:10)
    at emitOne (events.js:77:13)
    at process.emit (events.js:169:7)
    at process._fatalException (node.js:219:26)
    at process._asyncFatalException [as _fatalException]
(/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:211:34)
```

This was caused by the class name extracting calling path.relative with
undefined Test.file.

Here we protect extractClassName from doing so.
Pull Request #8: Fix TypeError when beforeEach throws

124 of 124 relevant lines covered (100.0%)

14.46 hits per line

Source Files on job 29.1
  • Tree
  • List 0
  • Changed 5
  • Source Changed 2
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 29
  • Travis Job 29.1
  • 706c7091 on github
  • Prev Job for on master (#28.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc