Created
November 21, 2011 18:26
-
-
Save wilsonpage/1383436 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
head | |
meta(charset="utf-8") | |
meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1") | |
title= title | |
link(rel='stylesheet', href='/public/js/libs/qunit/qunit.css') | |
script(src="/public/js/libs/qunit/qunit.js") | |
script(data-main="/public/js/app-test", src="/public/js/libs/require/require.js") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require.config({ | |
paths: { | |
jQuery: 'libs/jquery/jquery', | |
Underscore: 'libs/underscore/underscore', | |
Backbone: 'libs/backbone/backbone', | |
Modernizr: 'libs/modernizr/modernizr', | |
FileUploader: 'libs/fileuploader/fileuploader', | |
modules: 'app/modules', | |
testModules: 'app/test/modules', | |
templates: '../templates', | |
text: 'libs/require/text', | |
order: 'libs/require/order' | |
} | |
}); | |
require([ | |
'app/test/test-runner', | |
// Some plugins have to be loaded in order due to there non AMD compliance | |
// Because these scripts are not "modules" they do not pass any values to the definition function below | |
'libs/modernizr/modernizr-min', | |
'libs/fileuploader/valums-file-uploader', | |
'order!libs/jquery/jquery-min', | |
'order!libs/underscore/underscore-min', | |
'order!libs/backbone/backbone-min', | |
], function(TestRunner){ | |
TestRunner(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'jQuery', | |
'Underscore', | |
'Backbone', | |
'modules/feed' | |
], function($, _, Backbone, Feed){ | |
return function(){ | |
test('first test', function() { | |
ok(Feed, 'Feed module loaded an ready for testing'); | |
}) | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'testModules/feed.test', | |
'testModules/members.test', | |
'testModules/files.test', | |
], function(){ | |
var testModules = arguments; | |
return function(){ | |
// cache length | |
var num = TestModules.length; | |
// run each test module | |
for(var i=0; i<num; i++){ TestModules[i]() } | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment