amdjs/backbone — pull request #2 by fkowal (2012-03-21 10:56:42+00:00)
Title: requestjs + Backbone + jsTestDriver

Hi

I've been recently experimenting with jsTestDriver
and after writing a simple Backbone model

define('ticker/router', ['Backbone'], function (Backbone) {
var TickerRouter = Backbone.Router.extend({...});
return TickerRouter;
})

i wanted to test it with jsTestDriver

ticker.jstd
server: http://localhost:9876

load:
//# inject requirejs depencies used by router, model, typeView
- ../../libs/require-1.0.7.js
- ../../libs/underscore.js
- ../../libs/jquery-1.7.1.min.js
- ../../libs/backbone.js
- router.js

test:
- tests/routerTest.js

jsTestDriver fails to load Backbone

TickerRequirejsTest.testModel error (2,00 ms): Error: Mismatched anonymous define() module: function (_, $, exports) {
root.Backbone = factory(root, exports, _, $);

it's because the AMD definition is missing a name of the module.

Please review my patch.

After applying this patch requirejs + Backbone + jsTestDriver work easy without problems with Async loading

This is my first pull request so i hope i am doing this right.