Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit a1e872c

Browse files
committed
tweak timeout messaging; see mochajs#2294
1 parent 27b212a commit a1e872c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/runnable.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ Runnable.prototype.resetTimeout = function () {
229229
if (!self._enableTimeouts) {
230230
return;
231231
}
232-
self.callback(new Error('timeout! Test didn\'t complete within ' + ms +
233-
'. For async tests, make sure you are calling \'done\' or that the returned Promise eventually resolves.'));
232+
self.callback(new Error('Timeout of ' + ms +
233+
'ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.'));
234234
self.timedOut = true;
235235
}, ms);
236236
};
@@ -289,8 +289,8 @@ Runnable.prototype.run = function (fn) {
289289
self.duration = new Date() - start;
290290
finished = true;
291291
if (!err && self.duration > ms && self._enableTimeouts) {
292-
err = new Error('timeout! Test didn\'t complete within ' + ms +
293-
'. For async tests, make sure you are calling \'done\' or that the returned Promise eventually resolves.');
292+
err = new Error('Timeout of ' + ms +
293+
'ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.');
294294
}
295295
fn(err);
296296
}

0 commit comments

Comments
 (0)