Skip to content
Permalink
Browse files

Tests: Fix AMD loading in IE8

It appears that we must load require.js via a standard script tag in order
for it to work properly in IE8.
  • Loading branch information
scottgonzalez committed Apr 17, 2015
1 parent 45797b9 commit 6231b161b92d28bdb6657cdd1f7d11436e6b132d
@@ -239,7 +239,8 @@ grunt.initConfig({
"ui/*.js",
"Gruntfile.js",
"build/**/*.js",
"tests/unit/**/*.js"
"tests/unit/**/*.js",
"tests/lib/**/*.js"
]
},
csslint: {
@@ -6,7 +6,6 @@
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "double",
"smarttabs": true,
"trailing": true,
@@ -31,6 +30,8 @@
"notStrictEqual": false,
"ok": false,
"QUnit": true,
"require": true,
"requirejs": true,
"start": false,
"strictEqual": false,
"stop": false,
@@ -1,6 +1,6 @@
( function() {

window.requirejs = {
requirejs.config({
paths: {
"globalize": "../../../external/globalize/globalize",
"globalize/ja-JP": "../../../external/globalize/globalize.culture.ja-JP",
@@ -20,7 +20,19 @@ window.requirejs = {
"qunit-assert-classes": [ "qunit" ],
"qunit-assert-close": [ "qunit" ]
}
};
});

// Create a module that disables back compat for UI modules
define( "jquery-no-back-compat", [ "jquery" ], function( $ ) {
$.uiBackCompat = false;

return $;
} );

// Create a dummy bridge if we're not actually testing in PhantomJS
if ( !/PhantomJS/.test( navigator.userAgent ) ) {
define( "phantom-bridge", function() {} );
}

// Load all modules in series
function requireModules( dependencies, callback, modules ) {
@@ -83,7 +95,7 @@ function jqueryUrl() {
}

return url;
};
}

function swarmInject() {
var url = parseUrl().swarmURL;
@@ -134,26 +146,7 @@ function swarmInject() {
}
}

// Load requirejs, then load the tests
script = document.createElement( "script" );
script.src = "../../../external/requirejs/require.js";
script.onload = function() {

// Create a module that disables back compat for UI modules
define( "jquery-no-back-compat", [ "jquery" ], function( $ ) {
$.uiBackCompat = false;

return $;
} );

// Create a dummy bridge if we're not actually testing in PhantomJS
if ( !/PhantomJS/.test( navigator.userAgent ) ) {
define( "phantom-bridge", function() {} );
}

requireTests( modules, noBackCompat );
};
document.documentElement.appendChild( script );
requireTests( modules, noBackCompat );
} )();

} )();
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Accordion Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core accordion"></script>
<script src="../../lib/bootstrap.js" data-widget="accordion"></script>
<style>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Autocomplete Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core menu autocomplete"></script>
<script src="../../lib/bootstrap.js" data-widget="autocomplete"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Button Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core button"></script>
<script src="../../lib/bootstrap.js" data-widget="button"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Core Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js"></script>
<script src="../../lib/bootstrap.js" data-modules="core selector"></script>
<style>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Datepicker Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core datepicker"></script>
<script src="../../lib/bootstrap.js" data-widget="datepicker"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Dialog Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core button dialog"></script>
<script src="../../lib/bootstrap.js" data-widget="dialog" data-deprecated="true"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Dialog Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core button dialog"></script>
<script src="../../lib/bootstrap.js" data-widget="dialog" data-no-back-compat="true"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Draggable Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core"></script>
<script src="../../lib/bootstrap.js" data-widget="draggable"></script>
<style>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Droppable Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core"></script>
<script src="../../lib/bootstrap.js" data-widget="droppable" data-deprecated="true"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Droppable Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core"></script>
<script src="../../lib/bootstrap.js" data-widget="droppable"
data-no-back-compat="true"></script>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Effects Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js"></script>
<script src="../../lib/bootstrap.js" data-modules="core scale">
</script>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Menu Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core menu"></script>
<script src="../../lib/bootstrap.js" data-widget="menu"></script>
<style>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Position Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js"></script>
<script src="../../lib/bootstrap.js" data-modules="core"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Progressbar Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core progressbar"></script>
<script src="../../lib/bootstrap.js" data-widget="progressbar"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Resizable Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core resizable"></script>
<script src="../../lib/bootstrap.js" data-widget="resizable"></script>
<style>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Selectable Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core selectable"></script>
<script src="../../lib/bootstrap.js" data-widget="selectable"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Selectmenu Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core menu selectmenu"></script>
<script src="../../lib/bootstrap.js" data-widget="selectmenu"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Slider Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core slider"></script>
<script src="../../lib/bootstrap.js" data-widget="slider"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Sortable Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core"></script>
<script src="../../lib/bootstrap.js" data-widget="sortable"></script>
<style>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Spinner Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core button spinner"></script>
<script src="../../lib/bootstrap.js" data-widget="spinner"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Tabs Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core tabs"></script>
<script src="../../lib/bootstrap.js" data-widget="tabs"></script>
<style>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Tooltip Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core tooltip"></script>
<script src="../../lib/bootstrap.js" data-widget="tooltip" data-deprecated="true"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Tooltip Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core tooltip"></script>
<script src="../../lib/bootstrap.js" data-widget="tooltip" data-no-back-compat="true"></script>
</head>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Widget Test Suite</title>

<script src="../../../external/requirejs/require.js"></script>
<script src="../../lib/css.js" data-modules="core"></script>
<script src="../../lib/bootstrap.js" data-modules="core extend animation classes">
</script>

0 comments on commit 6231b16

Please sign in to comment.
You can’t perform that action at this time.