Skip to content

Calling done() after this.skip() results in 'done() called multiple times' #2465

@cressie176

Description

@cressie176

The following code skips the test in mocha v2, but causes an error in v3

Test

describe('broken skip behaviour', function() {
    it('should not report done() called multiple times', function(done) {
        this.skip()
        done()
    })
})

v2 Output

  broken skip behaviour
    - should not report done() called multiple times


  0 passing (11ms)
  1 pending

v3 Output

  broken skip behaviour
    - should not report done() called multiple times
    1) should not report done() called multiple times


  0 passing (15ms)
  1 pending
  1 failing

  1) broken skip behaviour should not report done() called multiple times:
     Error: done() called multiple times
      at Suite.<anonymous> (test/index.test.js:3:5)
      at Object.<anonymous> (test/index.test.js:1:63)
      at require (internal/module.js:20:19)
      at Array.forEach (native)
      at node.js:463:3

Unfortunately I rely on this behaviour for skipping tests in Yadda.

I've tried with various version of mocha from 1-3 and it looks like I can simply remove the call to done() in all versions. Can you confirm?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: buga 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