Skip to content

Instantly share code, notes, and snippets.

@roycehaynes
Created March 27, 2013 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roycehaynes/26376f8aa213e6de654a to your computer and use it in GitHub Desktop.
Save roycehaynes/26376f8aa213e6de654a to your computer and use it in GitHub Desktop.
config.js (aka main.js)
require.config({
deps: [
'main',
'util/jquery.cookie',
'util/sprintf',
'util/uri',
'util/hashids',
'util/sha1'
],
paths: {
// application javascript.
libs: '../assets/js',
// Libraries
util: '../vendor/js/utilities',
plugins: '../vendor/js/plugins',
jquery:'../vendor/js/jquery-1.9.1.min',
underscore: '../vendor/js/underscore-1.4.4.min',
//backbone: '../vendor/js/backbone-0.9.9.min',
backbone: '../vendor/js/backbone',
stackmob: '../vendor/js/stackmob-0.7.0',
stripe: '../vendor/js/stripe/v1/stripe',
qunit: 'tests/qunit/1.11.0/qunit',
//jasmine:'tests/jasmine/1.3.1/jasmine',
//'jasmine-html':'tests/jasmine/1.3.1/jasmine-html',
text: '../vendor/js/text'
},
shim: {
underscore: {
exports: '_'
},
backbone: {
deps: ['underscore'],
exports: 'Backbone'
},
stackmob: {
deps: ['backbone'],
exports: 'StackMob'
},
'util/hashids': [],
'util/uri': [],
'util/sprintf': [],
'util/sha1': [],
'util/jquery.cookie': [],
'plugins/backbone.safe' : ['backbone'],
'plugins/backbone.layoutmanager': ['backbone'],
'plugins/backbone.modal' : ['backbone'],
'plugins/backbone.validation.amd' : ['backbone'],
qunit: {
exports: 'QUnit'
}
}
});
define( ["stackmob", "stripe", "qunit"],
function(StackMob, Stripe, QUnit) {
// Initialize StackMob API
StackMob.init({
appName: "mycreate",
clientSubdomain: "",
publicKey: "",
apiVersion: 0,
userSchema: "user",
apiURL: "https://api.stackmob.com/"
});
//TODO: swap out for production key
Stripe.setPublishableKey('');
QUnit.config.autostart = false;
QUnit.start(); //Tests loaded, run tests
}
);
@spencercarnage
Copy link

Looking into it some more, loading QUnit through require seems to cause problems with the runner. I would load it as a separate script tag in the html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment