Skip to content

Commit

Permalink
add comment about the require cache, per guidance in mochajs#3084 (co…
Browse files Browse the repository at this point in the history
  • Loading branch information
finnigantime committed Nov 24, 2017
1 parent 4d16518 commit 1fe25ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Using-mocha-programmatically.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mocha.run(function(failures){
});
```

`mocha.run()` returns a `Runner` instance which emits many [events](https://github.com/mochajs/mocha/blob/8cae7a34f0b6eafeb16567beb8852b827cc5956b/lib/runner.js#L47-L57) of interest.
`mocha.run()` returns a `Runner` instance which emits many [events](https://github.com/mochajs/mocha/blob/8cae7a34f0b6eafeb16567beb8852b827cc5956b/lib/runner.js#L47-L57) of interest. Note that `run` (via `loadFiles`, which it calls) relies on Node's `require` to execute the test interface functions. Thus, files loaded by mocha will be stored in Node's `require` cache and therefore tests in these files will not be re-run if `mocha.run()` is called again. If you want to run tests multiple times, you may need to clear Node's `require` cache before subsequent calls in whichever manner best suits your needs.

## Set options

Expand Down

0 comments on commit 1fe25ef

Please sign in to comment.