Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests don't pass with --watch #262

Closed
GraemeF opened this issue Feb 12, 2012 · 2 comments
Closed

Tests don't pass with --watch #262

GraemeF opened this issue Feb 12, 2012 · 2 comments

Comments

@GraemeF
Copy link

GraemeF commented Feb 12, 2012

I've cloned the mocha repository and bin/mocha shows all 62 tests are passing. If I run bin/mocha --watch and make a whitespace change to a source file then I get 13 failures with the following output:

$ bin/mocha --watch


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

  ✖ 13 of 62 tests failed:

  1) Runnable(title, fn) #timeout(ms) should set the timeout:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  2) Runnable(title, fn) .title should be present:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  3) Runnable(title, fn) when arity >= 1 should be .async:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  4) Runnable(title, fn) when arity == 0 should be .sync:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  5) Runnable(title, fn) .run(fn) when .pending should not invoke the callback:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  6) Runnable(title, fn) .run(fn) when sync without error should invoke the callback:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  7) Runnable(title, fn) .run(fn) when sync when an exception is thrown should invoke the callback:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  8) Runnable(title, fn) .run(fn) when async without error should invoke the callback:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  9) Runnable(title, fn) .run(fn) when async when the callback is invoked several times without an error should emit a single "error" event:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  10) Runnable(title, fn) .run(fn) when async when the callback is invoked several times with an error should emit a single "error" event:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  11) Runnable(title, fn) .run(fn) when async when an exception is thrown should invoke the callback:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  12) Runnable(title, fn) .run(fn) when async when an error is passed should invoke the callback:
     TypeError: Cannot call method 'test' of undefined
      at Runner.runTest (/home/graeme/Development/mocha/lib/runner.js:268:14)
      at /home/graeme/Development/mocha/lib/runner.js:316:12
      at next (/home/graeme/Development/mocha/lib/runner.js:199:14)
      at /home/graeme/Development/mocha/lib/runner.js:208:7
      at next (/home/graeme/Development/mocha/lib/runner.js:157:23)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

  13) serial "before each" hook:
     TypeError: Cannot call method 'test' of undefined
      at next (/home/graeme/Development/mocha/lib/runner.js:159:14)
      at Array.0 (/home/graeme/Development/mocha/lib/runner.js:176:5)
      at EventEmitter._tickCallback (node.js:192:40)

I'm getting similar errors with my own tests, again only when using --watch, especially TypeError: Cannot call method 'test' of undefined.

@FGRibreau
Copy link

Same here

@tj
Copy link
Contributor

tj commented Feb 14, 2012

i'll try and take a look today

@tj tj closed this as completed in 84e6a15 Feb 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants