Skip to content

"PhantomJS timed out, possibly due to a missing Mocha run() call" regression #1700

@eddies

Description

@eddies

I'm getting a

Warning: PhantomJS timed out, possibly due to a missing Mocha run() call. Use --force to continue.

after upgrading mocha from 2.1.0 to 2.2.0 (or any of the 2.2.x series, including the most recent 2.2.5 release).

I've managed to track it to 521b7e4, specifically, lines 4485-4488:

    // Discard the resolution if this test has already failed asynchronously
    if (self.state) return;

Commenting out if (self.state) return; eliminates the error (I've tested against mocha 2.2.0 and 2.2.5).

Steps to reproduce:

Disclaimer: I never used mocha, grunt, yeoman, bower, or npm prior to two weeks ago, so I fully accept that the problem lies solely with how I'm testing rather than a problem with mocha itself. That said, I noticed this problem using Yeoman's generator-webapp after updating mocha in bower.json from 1.14.0 to 2.2.4. Dropping to v2.1.0 fixed the issue.
I've pushed a stripped-down, minimal version of an "app" that reproduces the problem: https://github.com/eddies/mocha-test-case

git clone [email protected]:eddies/mocha-test-case.git
cd mocha-test-case
npm install && bower install
grunt test

Comment out line 4512 of bower_components/mocha/mocha.js and re-run grunt test for the test to now pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions