Skip to content

Commit 526ffc1

Browse files
finnigantimeScottFreeCode
authored andcommitted
add cache comment
add comment advising deletion from require cache if mocha is invoked programmatically multiple times
1 parent 8a8331f commit 526ffc1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/mocha.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,14 @@ Mocha.prototype.forbidPending = function () {
505505
/**
506506
* Run tests and invoke `fn()` when complete.
507507
*
508+
* Note that `loadFiles` relies on Node's `require` to execute
509+
* the test interface functions and will be subject to the
510+
* cache - if the files are already in the `require` cache,
511+
* they will effectively be skipped. Therefore, to run tests
512+
* multiple times or to run tests in files that are already
513+
* in the `require` cache, make sure to clear them from the
514+
* cache first in whichever manner best suits your needs.
515+
*
508516
* @api public
509517
* @param {Function} fn
510518
* @return {Runner}

0 commit comments

Comments
 (0)