diff options
author | Timo Tijhof <krinklemail@gmail.com> | 2017-08-01 09:52:45 -0700 |
---|---|---|
committer | Timmy Willison <4timmywil@gmail.com> | 2017-12-18 12:27:38 -0500 |
commit | ecd8ddea33dc40ae2a57e4340be03faf2ba2f99b (patch) | |
tree | d0f248befa82620226708059db84bc3a7f1ec076 /test/karma.debug.html | |
parent | e84d3bc02eddeb0e0ca0438952ac560a794ff463 (diff) | |
download | jquery-ecd8ddea33dc40ae2a57e4340be03faf2ba2f99b.tar.gz jquery-ecd8ddea33dc40ae2a57e4340be03faf2ba2f99b.zip |
Tests: Add support for running unit tests via grunt with karma
- Update QUnit to 1.23.1
- Remove unused dl#dl from test/index.html
- Remove unused map#imgmap from test/index.html
- Ensure all urls to data use baseURI
- Add the 'grunt karma:main' task
- customContextFile & customDebugFile
- Add 'npm run jenkins' script
Close gh-3744
Fixes gh-1999
Diffstat (limited to 'test/karma.debug.html')
-rw-r--r-- | test/karma.debug.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/karma.debug.html b/test/karma.debug.html new file mode 100644 index 000000000..950064db7 --- /dev/null +++ b/test/karma.debug.html @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html lang="en" id="html"> +<head> +%X_UA_COMPATIBLE% + <title>DEBUG</title> + <meta charset="utf-8"> + <!-- Karma serves this page from /context.html. Other files are served from /base --> + <link rel="stylesheet" href="/base/external/qunit/qunit.css" /> + <link rel="stylesheet" href="/base/test/data/testsuite.css" /> +</head> +<body id="body"> + <div id="qunit"></div> + + <!-- Start: jQuery 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="/base/test/data/iframe.html"></iframe> + <div id="qunit-fixture"></div> + <!-- End: jQuery Test HTML --> + + <!-- Start: Karma boilerplate --> + <script src="/context.js"></script> + <script src="/debug.js"></script> + <script> + %CLIENT_CONFIG% + + %MAPPINGS% + </script> + %SCRIPTS% + <!-- End: Karma boilerplate --> + + <script src="/base/test/data/qunit-fixture.js"></script> + <script> + // Workaround: Remove call to window.__karma__.loaded() + // in favour of calling window.__karma__.start() at window.onload + // because tests such as unit/ready.js should run after document ready + window.addEventListener('load', function() { + window.__karma__.start(); + + // Workaround: https://github.com/karma-runner/karma-qunit/issues/92 + QUnit.testStart(function () { + // Restore content + document.getElementById("qunit-fixture").innerHTML = QUnit.config.fixture; + }); + }); + </script> +</body> +</html> |