modula

Dead simple library which helpes with modalar testing. Provides Node.js's require replacement. Designed to work with Karma test runner.

Modula.js

Modula is dead simple library which helps with modular testing. I was needed it for Node.js's require replacement to use with Karma test runner.

  1. Define module:
# ... 
 
if modula?
  modula.export('lisn'Lisn)
else if module?
  module.exports = Lisn
else
  window.Lisn = Lisn
  1. Use it in specs:
Lisn = require('lisn')
 
# ... 
  1. That's it!

modula avaliable as npm and bower json.

modula is a global namespace.

Saves exports associated with passed module name.

modula.export('backbone'Backbone)

Returns module associated with name. Also avaliable as window.require.

Backbone = require('backbone')

If module is not found, modula will throw exception.