brunch/brunch — pull request #577 by benjamincox (2013-05-24 22:16:58+00:00)
Title: Exposes loaded modules as globals.require.modules for testing convenience

This allows me to run all of the tests under the test/ directory by filename convention, rather than having to list them all. Here's how that looks in my codebase

tests/initialize.coffee:

tests = []

for module of window.require.modules
tests.push module if module.substring(module.length - 5) is "_test"

for test in tests
require test

tests/assets/test/index.html:

...

...