Refactoring unit tests to work with requirejs