Skip to content

"done" should fail when called multiple times #7052

@martypdx

Description

@martypdx

I did some online searching and didn't find any discussion, so let me know if this is as expected. Happy to do a PR if this should be correct behavior

🐛 Bug Report

Calling done() multiple times in one test should be a failure, but it succeeds

To Reproduce

it('should fail when done called second time', done => {
  done();
  done();
});

Expected behavior

Test fails with "done" called multiple times or some such message

Link to repl or repo (highly encouraged)

Above code snippet showcases issue. Looks like following test could be added to e2e failures:

test('done();done()', done => {
  done();
  done();
});

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS High Sierra 10.13.6
    CPU: x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
  Binaries:
    Node: 10.3.0 - /usr/local/bin/node
    Yarn: 1.5.1 - /usr/local/bin/yarn
    npm: 6.1.0 - /usr/local/bin/npm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions