"nextTick is not a function" error on async testing #267

pelicanorojo opened this Issue Apr 8, 2013 · 2 comments


None yet
2 participants


sometimes on async testing the error "nextTick is not a function" is show on console.
To solve this, you must add ( && process.nextTick ) in q.js code near line 76:
// use the fastest possible means to execute a task in a future turn
// of the event loop.
var nextTick;
if (typeof process !== "undefined" && process.nextTick ) {//<== put these to detect mocha node process mock.
// node
nextTick = process.nextTick;
} else if (typeof setImmediate === "function") {


domenic commented Apr 8, 2013

Thanks. I've noticed this in several libraries recently; I wonder if it's a recent change in Mocha. Will fix ASAP.

Great! I am using q with mocha and phantomjs, and also in my application in parallel load synchronization.

domenic closed this in 7b03bca Apr 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment