substack/browser-pack — pull request #16 by benjamn (2013-07-08 20:30:19+00:00)
Title: Expose require.dumpCache() for resetting the module cache

Resetting the module cache is an important point of hygiene when running multiple tests, and sometimes within a single test, because it prevents earlier test activity from interfering with current test behavior.

Without modifying prelude.js, it seems to be impossible to modify the cache in any way. Unfortunately, shipping a modified version of prelude.js requires forking both browserify and browser-pack.

Another option would be to use something other than browserify for tests, but then the benefits of end-to-end testing of the actual browserified bundle would be lost.

Am I missing an easier way of clearing the cache?