mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge remote-tracking branch 'ducksboard/bug-493-jquery-no-global-fail'
* ducksboard/bug-493-jquery-no-global-fail: Fix for bug #493 including unit tests to prove.
This commit is contained in:
53
test/amd-main.js
Normal file
53
test/amd-main.js
Normal file
@ -0,0 +1,53 @@
|
||||
//Based on https://github.com/jonnyreeves/qunit-require
|
||||
/* global require */
|
||||
"use strict";
|
||||
require.config({
|
||||
//set the baseUrl to the src dir so that gridster
|
||||
//AMD modules can be found.
|
||||
baseUrl: '../src/',
|
||||
paths: {
|
||||
'QUnit': '../libs/qunit/qunit/qunit',
|
||||
'jquery': '../libs/jquery/jquery',
|
||||
'gridster': 'jquery.gridster'
|
||||
},
|
||||
map: {
|
||||
// '*' means all modules will get 'jquery-private'
|
||||
// for their 'jquery' dependency.
|
||||
'*': { 'jquery': '../test/jquery-private' },
|
||||
|
||||
// 'jquery-private' wants the real jQuery module
|
||||
// though. If this line was not here, there would
|
||||
// be an unresolvable cyclic dependency.
|
||||
'../test/jquery-private': { 'jquery': 'jquery' }
|
||||
},
|
||||
shim: {
|
||||
'QUnit': {
|
||||
exports: 'QUnit',
|
||||
init: function() {
|
||||
QUnit.config.autoload = false;
|
||||
QUnit.config.autostart = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
/*
|
||||
Load all of our require'd files
|
||||
|
||||
We have to load all of the gridster jquery.* modules so
|
||||
that they are defined for when gridster needs them.
|
||||
|
||||
Lastly, load the testsuite which defines some tests.
|
||||
*/
|
||||
require([
|
||||
'QUnit',
|
||||
'utils',
|
||||
'jquery.coords',
|
||||
'jquery.collision',
|
||||
'jquery.draggable',
|
||||
'../test/testsuite'
|
||||
//Require'd files are passed as args, but we don't use them.
|
||||
], function(QUnit/*, utils, coords, collision, draggable, testsuite*/) {
|
||||
QUnit.load();
|
||||
QUnit.start();
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user