Skip to content

Uncaught TypeError: Cannot read property 'currentRetry' of undefined

Closed

Description

Tested on Mocha 2.5.3.

When uncaught error is thrown during "before" phase additional "Uncaught TypeError: Cannot read property 'currentRetry' of undefined" error is thrown from mocha.

Simple test case:

'use strict';

describe('test', function () {
    before(function () {
        require('http').createServer().listen(1);
    });

    it('something', function () {
    });
});

output:

  test
    1) "before all" hook

  2) Uncaught error outside test suite

  0 passing (27ms)
  2 failing

  1) test "before all" hook:
     Uncaught Error: listen EACCES 0.0.0.0:1
      at Object.exports._errnoException (util.js:953:11)
      at exports._exceptionWithHostPort (util.js:976:20)
      at Server._listen2 (net.js:1240:19)
      at listen (net.js:1289:10)
      at Server.listen (net.js:1385:5)
      at Context.<anonymous> (test/test.js:5:40)

  2) test Uncaught error outside test suite:
     Uncaught TypeError: Cannot read property 'currentRetry' of undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    type: buga defect, confirmed by a maintainera defect, confirmed by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions