pandell/mocha-testdata — pull request #8 by 101100 (2014-10-09 14:49:25+00:00)
Title: No cases fails test

This changes the behaviour for the case when no test data is given to `given`. Previously, this threw an exception, which caused mocha to crash, since it was happening during setup and not during the tests. This modified version instead returns tests that will always fail, giving more useful feedback and a stack trace.

Example output before:

```
C:\Users\dev\Documents\GitHub\Project>tools\Run-Gulp.cmd test
********************************************************
Client build in: "C:\Users\dev\Documents\GitHub\Project\src\Company.Project.Web"
********************************************************
[12:53:47] Using gulpfile ~\Documents\GitHub\Project\src\Company.Project.Web\gulpfile.js
[12:53:47] Starting 'lint'...
[12:53:50] Finished 'lint' after 4.25 s
[12:53:50] Starting 'test:unit'...
[12:53:50] Running unit tests
[12:53:50] 'test:unit' errored after 317 ms
[12:53:50] Error in plugin 'gulp-mocha'
Message:
[test-data] at least one argument is required.
Gulp failed with error 1.

C:\Users\dev\Documents\GitHub\Project>
```

Example output now:

```
C:\Users\dev\Documents\GitHub\Project>tools\Run-Gulp.cmd

********************************************************
Client build in: "C:\Users\dev\Documents\GitHub\Project\src\Company.Project.Web"
********************************************************
[14:32:40] Using gulpfile ~\Documents\GitHub\Project\src\Company.Project.Web\gulpfile.js
[14:32:40] Starting 'clean:css'...
[14:32:40] Starting 'clean:sprites'...
[14:32:40] Starting 'lint'...
[14:32:41] Finished 'clean:sprites' after 429 ms
[14:32:41] Starting 'rebuild:sprites'...
[14:32:42] Finished 'clean:css' after 1.41 s
[14:32:45] Finished 'lint' after 4.76 s
[14:32:45] Starting 'test:unit'...
[14:32:45] Running unit tests

.....................

20 passing (206ms)
1 failing

1) shipperCodeViewModel should load 'undefined' correctly:
Error: moche-testdata used without test data.
at Context. (C:\Users\dev\Documents\GitHub\Project\src\Company.Project.Web\node_modules\mocha-testdata\index.js:15:15)
at callFn (C:\Users\dev\Documents\GitHub\Project\node_modules\mocha\lib\runnable.js:249:21)
at Test.Runnable.run (C:\Users\dev\Documents\GitHub\Project\node_modules\mocha\lib\runnable.js:242:7)
at Runner.runTest (C:\Users\dev\Documents\GitHub\Project\node_modules\mocha\lib\runner.js:373:10)
at C:\Users\dev\Documents\GitHub\Project\node_modules\mocha\lib\runner.js:451:12
at next (C:\Users\dev\Documents\GitHub\Project\node_modules\mocha\lib\runner.js:298:14)
at C:\Users\dev\Documents\GitHub\Project\node_modules\mocha\lib\runner.js:308:7
at next (C:\Users\dev\Documents\GitHub\Project\node_modules\mocha\lib\runner.js:246:23)
at Object._onImmediate (C:\Users\dev\Documents\GitHub\Project\node_modules\mocha\lib\runner.js:275:5)
at processImmediate [as _immediateCallback] (timers.js:345:15)

[14:32:46] 'test:unit' errored after 846 ms
[14:32:46] Error in plugin 'gulp-mocha'
Message:
1 test failed.
[14:32:46] Finished 'rebuild:sprites' after 5.19 s
Gulp failed with error 1.

C:\Users\dev\Documents\GitHub\Project>
```