🌐 AI搜索 & 代理 主页
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,31 @@ module.exports = function( grunt ) {

"test/jquery.js",

{ pattern: "dist/jquery.*", included: false, served: true },
{ pattern: "src/**", type: "module", included: false, served: true },
{ pattern: "amd/**", included: false, served: true },
{
pattern: "dist/jquery.*",
included: false,
served: true,
nocache: true
},
{
pattern: "src/**",
type: "module",
included: false,
served: true,
nocache: true
},
{
pattern: "amd/**",
included: false,
served: true,
nocache: true
},
{ pattern: "node_modules/**", included: false, served: true },
{
pattern: "test/**/*.@(js|css|jpg|html|xml|svg)",
included: false,
served: true
served: true,
nocache: true
}
],
reporters: [ "dots" ],
Expand Down
33 changes: 22 additions & 11 deletions test/jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,34 @@
( function() {
/* global loadTests: false */

var dynamicImportSource,
var dynamicImportSource, config, src,
FILEPATH = "/test/jquery.js",
activeScript = [].slice.call( document.getElementsByTagName( "script" ), -1 )[ 0 ],
parentUrl = activeScript && activeScript.src ?
activeScript.src.replace( /[?#].*/, "" ) + FILEPATH.replace( /[^/]+/g, ".." ) + "/" :
"../",
QUnit = window.QUnit,
require = window.require,
require = window.require;

function getQUnitConfig() {
var config = Object.create( null );

// Default to unminified jQuery for directly-opened iframes
config = QUnit ?
if ( !QUnit ) {
config.dev = true;
} else {

// QUnit.config is populated from QUnit.urlParams but only at the beginning
// of the test run. We need to read both.
{
esmodules: !!( QUnit.config.esmodules || QUnit.urlParams.esmodules ),
amd: !!( QUnit.config.amd || QUnit.urlParams.amd )
} :
QUnit.config.urlConfig.forEach( function( entry ) {
config[ entry.id ] = QUnit.config[ entry.id ] != null ?
QUnit.config[ entry.id ] :
QUnit.urlParams[ entry.id ];
} );
}

{ dev: true },
src = config.dev ?
"dist/jquery.js" :
"dist/jquery.min.js";
return config;
}

// Define configuration parameters controlling how jQuery is loaded
if ( QUnit ) {
Expand All @@ -43,6 +48,12 @@
} );
}

config = getQUnitConfig();

src = config.dev ?
"dist/jquery.js" :
"dist/jquery.min.js";

// Honor ES modules loading on the main window (detected by seeing QUnit on it).
// This doesn't apply to iframes because they synchronously expect jQuery to be there.
if ( config.esmodules && QUnit ) {
Expand Down