Commit 9f433d9f authored by Timmy Willison's avatar Timmy Willison

Use window.QUnit to detect the top window when loading with AMD

parent b718a169
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
label: "Load with AMD", label: "Load with AMD",
tooltip: "Load the AMD jQuery file (and its dependencies)" tooltip: "Load the AMD jQuery file (and its dependencies)"
}); });
if ( QUnit.urlParams.amd && parent == window ) { // If QUnit is on window, this is the main window
// This detection allows AMD tests to be run in an iframe
if ( QUnit.urlParams.amd && window.QUnit ) {
require.config({ baseUrl: src }); require.config({ baseUrl: src });
src = "src/jquery"; src = "src/jquery";
// Include tests if specified // Include tests if specified
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment