jquery/test/index.html
Michał Gołębiowski-Owczarek d0ce00cdfa
Core: Migrate from AMD to ES modules 🎉
Migrate all source AMD modules to ECMAScript modules. The final bundle
is compiled by a custom build process that uses Rollup under the hood.

Test files themselves are still loaded via RequireJS as that has to work in
IE 11.

Tests can now be run in "Load as modules" mode which replaces the previous
"Load with AMD" option. That option of running tests doesn't work in IE
and Edge as it requires support for dynamic imports.

Some of the changes required by the migration:
* check `typeof` of `noGlobal` instead of using the variable directly
  as it's not available when modules are used
* change the nonce module to be an object as ECMASscript module exports
  are immutable
* remove some unused exports
* import `./core/parseHTML.js` directly in `jquery.js` so that it's not
  being cut out when the `ajax` module is excluded in a custom compilation

Closes gh-4541
2019-11-18 21:15:03 +01:00

48 lines
1.7 KiB
HTML

<!doctype html>
<html lang="en" id="html">
<head>
<meta charset="utf-8">
<title>jQuery Test Suite</title>
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css" />
<link rel="stylesheet" href="data/testsuite.css" />
<!--
We have to use previous jQuery as helper to ensure testability with
ajax-free builds (and non-interference when changing ajax internals)
-->
<script src="data/jquery-1.9.1.js"></script>
<script src="../node_modules/qunit/qunit/qunit.js"></script>
<script src="../node_modules/sinon/pkg/sinon.js"></script>
<script src="../node_modules/native-promise-only/lib/npo.src.js"></script>
<script src="../node_modules/requirejs/require.js"></script>
<!-- See testinit for the list of tests -->
<script src="data/testinit.js"></script>
<!-- A script that includes jQuery min, dev, or ES modules -->
<!-- Adds "basic" URL option, even to iframes -->
<!-- iframes will not load AMD as loading needs to be synchronous for some tests -->
<!-- Also executes the function above to load tests -->
<script src="jquery.js"></script>
<script>
// Load tests if they have not been loaded
// This is in a different script tag to ensure that
// jQuery is on the page when the testrunner executes
if ( !QUnit.urlParams.esmodules ) {
loadTests();
}
</script>
</head>
<body id="body">
<div id="qunit"></div>
<!-- Test HTML -->
<!-- this iframe is outside the #qunit-fixture so it won't waste time by constantly reloading; the tests are "safe" and clean up after themselves -->
<iframe id="loadediframe" name="loadediframe" style="display:none;" src="data/iframe.html"></iframe>
<div id="qunit-fixture"></div>
<script src="data/qunit-fixture.js"></script>
</body>
</html>