-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
204 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="icon" href="/favicon.svg"> | ||
<link rel="stylesheet" href="/assets/styles.css?v=b586456e" media="screen"> | ||
<link rel="alternate" type="application/rss+xml" href="/feed.xml" title="QUnit"> | ||
<title>QUnit.load() | QUnit</title> | ||
<meta property="og:title" content="QUnit.load()"><meta name="description" content="Inform the test runner that code has finished loading."><meta property="og:description" content="Inform the test runner that code has finished loading."><link rel="me" href="https://fosstodon.org/@qunit"><meta name="twitter:creator" content="@qunitjs"><meta name="twitter:site" content="@qunitjs"><meta name="twitter:card" content="summary_large_image"> | ||
<body> | ||
<header class="site-header" role="banner"> | ||
<div class="site-header-wrapper wrapper"> | ||
<a class="site-logo" href="https://qunitjs.com"><img src="/img/logo-with-colored-text.svg" alt="QUnit" width="250" height="72"></a><form role="search" class="tsmb-form" data-origin="https://typesense.jquery.com" data-collection="qunitjs_com" data-key="Zh8mMgohXECel9wjPwqT7lekLSG3OCgz" data-foot="true" action="https://duckduckgo.com"> | ||
<input type="search" name="q" aria-label="Search" placeholder="Search..." autocomplete="off"> | ||
<input type="hidden" name="sites" value="api.qunitjs.com"> | ||
</form> | ||
|
||
|
||
<nav class="site-nav"><ul class="site-nav-list"><li class="site-nav-item has-sub-list"><span class="site-nav-link has-sub-list" tabindex="0">Guides</span> | ||
<ul class="site-nav-sub-list"><li><a class="site-sub-nav-link" href="https://qunitjs.com/intro/">Getting Started</a></li><li><a class="site-sub-nav-link" href="https://qunitjs.com/cli/">Command-line interface</a></li><li><a class="site-sub-nav-link" href="https://qunitjs.com/plugins/">Plugins</a></li><li><a class="site-sub-nav-link" href="https://qunitjs.com/upgrade-guide-2.x/">2.x Upgrade Guide</a></li></ul></li><li class="site-nav-item"><a class="site-nav-link" href="/">Documentation</a></li><li class="site-nav-item has-sub-list"><span class="site-nav-link has-sub-list" tabindex="0">About</span> | ||
<ul class="site-nav-sub-list"><li><a class="site-sub-nav-link" href="https://qunitjs.com/projects/">Who's using QUnit?</a></li><li><a class="site-sub-nav-link" href="https://qunitjs.com/about/">About QUnit</a></li></ul></li></ul></nav> | ||
<div class="site-toggles"> | ||
<button class="search-toggle toggle" aria-expanded="false"> | ||
<span class="screen-reader-text">Search</span> | ||
<svg class="icon aa-input-icon" aria-hidden="true" viewBox="654 -372 1664 1664" height="20"> | ||
<path d="M1806,332c0-123.3-43.8-228.8-131.5-316.5C1586.8-72.2,1481.3-116,1358-116s-228.8,43.8-316.5,131.5 C953.8,103.2,910,208.7,910,332s43.8,228.8,131.5,316.5C1129.2,736.2,1234.7,780,1358,780s228.8-43.8,316.5-131.5 C1762.2,560.8,1806,455.3,1806,332z M2318,1164c0,34.7-12.7,64.7-38,90s-55.3,38-90,38c-36,0-66-12.7-90-38l-343-342 c-119.3,82.7-252.3,124-399,124c-95.3,0-186.5-18.5-273.5-55.5s-162-87-225-150s-113-138-150-225S654,427.3,654,332 s18.5-186.5,55.5-273.5s87-162,150-225s138-113,225-150S1262.7-372,1358-372s186.5,18.5,273.5,55.5s162,87,225,150s113,138,150,225 S2062,236.7,2062,332c0,146.7-41.3,279.7-124,399l343,343C2305.7,1098.7,2318,1128.7,2318,1164z"/> | ||
</svg> | ||
</button> | ||
<button class="nav-toggle toggle" data-opens=".site-nav" aria-expanded="false"> | ||
<span class="screen-reader-text">Menu</span> | ||
<svg class="icon icon-nav-toggle" aria-hidden="true" viewBox="0 0 100 100" height="20"> | ||
<path d="M5,16h90v16H5z"/> | ||
<path d="M5,48h90v16H5z"/> | ||
<path d="M5,80h90v16H5z"/> | ||
</svg> | ||
</button> | ||
<script type="module"> | ||
const searchToggle = document.querySelector('.search-toggle'); | ||
const searchForm = document.querySelector('form[role=search]'); | ||
const searchInput = searchForm.querySelector('input[type=search]'); | ||
function searchFn(newState) { | ||
searchToggle.setAttribute('aria-expanded', String(newState)); | ||
searchForm.style.display = newState ? 'block' : ''; | ||
if (newState) { | ||
searchInput.focus(); | ||
} | ||
} | ||
const navToggle = document.querySelector('.nav-toggle'); | ||
const navToggleOpens = document.querySelector(navToggle.dataset.opens); | ||
function navFn(newState) { | ||
navToggle.classList.toggle('opened', newState); | ||
navToggleOpens.classList.toggle('opened', newState); | ||
navToggle.setAttribute('aria-expanded', String(newState)); | ||
navToggleOpens.setAttribute('aria-expanded', String(newState)); | ||
} | ||
searchToggle.addEventListener('click', () => { | ||
navFn(false); | ||
searchFn(searchToggle.getAttribute('aria-expanded') !== 'true'); | ||
}); | ||
navToggle.addEventListener('click', () => { | ||
searchFn(false); | ||
navFn(!navToggle.classList.contains('opened')); | ||
}); | ||
</script> | ||
</div> | ||
</div> | ||
</header> | ||
<div class="main main--columns wrapper"> | ||
<div class="content" role="main"> | ||
<article> | ||
<header> | ||
<h1>QUnit.load()</h1> | ||
<p class="post-meta">Categories: <a class="category" href="/deprecated/">Deprecated methods</a>.</p> | ||
</header> | ||
<p class="version-details"> | ||
version added: <a href="https://github.com/qunitjs/qunit/releases/tag/1.0.0">1.0.0</a><span class="sep">.</span> | ||
deprecated: unreleased<span class="sep">.</p> | ||
<h2 id="description" class="screen-reader-text h-api-desc">Description</h2> | ||
<p><code class="language-plaintext highlighter-rouge">QUnit.load()</code></p> | ||
|
||
<p>Inform the test runner that your source code and tests have finished loading.</p> | ||
|
||
<p>This method was used in conjunction with the <a href="/config/autostart/"><code class="language-plaintext highlighter-rouge">QUnit.config.autostart</code></a> option in a web browser, to indicate when your custom way of loading scripts is complete.</p> | ||
|
||
<p>As of <a href="https://github.com/qunitjs/qunit/releases/tag/2.1.1">QUnit 2.1.1</a>, calls to <code class="language-plaintext highlighter-rouge">QUnit.load()</code> are no longer needed. Existing calls are usually ignored and safe to remove.</p> | ||
|
||
<p class="note note--warning">This method is <strong>deprecated</strong>. Remove call, or replace by a single call to <a href="/QUnit/start/"><code class="language-plaintext highlighter-rouge">QUnit.start()</code></a>.</p> | ||
|
||
<h2 id="changelog">Changelog</h2> | ||
|
||
<table> | ||
<tbody> | ||
<tr> | ||
<td>UNRELEASED</td> | ||
<td>Deprecated. Use <a href="/QUnit/start/"><code class="language-plaintext highlighter-rouge">QUnit.start()</code></a> instead.</td> | ||
</tr> | ||
<tr> | ||
<td><a href="https://github.com/qunitjs/qunit/releases/tag/2.1.1">QUnit 2.1.1</a></td> | ||
<td><code class="language-plaintext highlighter-rouge">QUnit.start()</code> no longer requires calling <code class="language-plaintext highlighter-rouge">QUnit.load()</code> first.</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h2 id="migration-guide">Migration guide</h2> | ||
|
||
<p>If you still call <code class="language-plaintext highlighter-rouge">QUnit.load()</code> with QUnit 2.2 or later, the call is usually redundant and safe to remove.</p> | ||
|
||
<h3 id="if-you-call-both-qunitload-and-qunitstart">If you call both <code class="language-plaintext highlighter-rouge">QUnit.load()</code> and <code class="language-plaintext highlighter-rouge">QUnit.start()</code></h3> | ||
|
||
<p>If your project started with QUnit 1.x, and you use <code class="language-plaintext highlighter-rouge">QUnit.config.autostart = false</code>, then you might be calling both of these methods. In the QUnit 1.x era, <a href="/QUnit/start/"><code class="language-plaintext highlighter-rouge">QUnit.start()</code></a> required that you also call <code class="language-plaintext highlighter-rouge">QUnit.load()</code> first.</p> | ||
|
||
<p>This is no longer needed since <a href="https://github.com/qunitjs/qunit/releases/tag/2.1.1">QUnit 2.1.1</a>, and the call to <code class="language-plaintext highlighter-rouge">QUnit.load()</code> is safe to remove.</p> | ||
|
||
<h3 id="if-you-call-qunitload">If you call <code class="language-plaintext highlighter-rouge">QUnit.load()</code></h3> | ||
|
||
<p>Prior to QUnit 2.21, the built-in HTML Reporter called <code class="language-plaintext highlighter-rouge">QUnit.load()</code> from the window.onload event, which in turn gracefully calls <code class="language-plaintext highlighter-rouge">QUnit.start()</code> if it has not been called already.</p> | ||
|
||
<p>If your test runner works in a similar way, call <a href="/QUnit/start/"><code class="language-plaintext highlighter-rouge">QUnit.start()</code></a> instead of <code class="language-plaintext highlighter-rouge">QUnit.load()</code>. This will solve the deprecation warning and prepares you for QUnit 3.</p> | ||
|
||
<h3 id="karma-runner">Karma runner</h3> | ||
|
||
<p>If you encounter this warning in Karma output, upgrade to <a href="https://github.com/karma-runner/karma-qunit">karma-qunit</a> 4.2.0 or later, which <a href="https://github.com/karma-runner/karma-qunit/pull/184">fixes</a> this warning.</p> | ||
|
||
</article> | ||
</div> | ||
<aside class="sidebar" role="complementary"> | ||
|
||
<h4><a href="/QUnit/">Main methods</a></h4> | ||
|
||
|
||
<h4><a href="/assert/">Assertions</a></h4> | ||
|
||
|
||
<h4><a href="/callbacks/">Callback events</a></h4> | ||
|
||
|
||
<h4><a href="/async/">Async control</a></h4> | ||
|
||
|
||
<h4><a href="/config/">Configuration</a></h4> | ||
|
||
|
||
<h4><a href="/extension/">Extension interface</a></h4> | ||
|
||
|
||
<h4><a href="/deprecated/">Deprecated methods</a></h4> | ||
<hr><div class="toc-wrapper"> | ||
<h4>Table of contents</h4><ol class="toc"><li class="sidebar-item"><a href="#description">Description</a></li><li class="sidebar-item"><a href="#changelog">Changelog</a></li><li class="sidebar-item"><a href="#migration-guide">Migration guide</a><ol><li class="sidebar-item"><a href="#if-you-call-both-qunitload-and-qunitstart">If you call both QUnit.load() and QUnit.start()</a></li><li class="sidebar-item"><a href="#if-you-call-qunitload">If you call QUnit.load()</a></li><li class="sidebar-item"><a href="#karma-runner">Karma runner</a></li></ol></li></ol></div> | ||
</aside> | ||
|
||
</div> | ||
|
||
<footer class="site-footer"> | ||
<div class="wrapper"> | ||
<p class="external-links"> | ||
<a href="https://github.com/qunitjs" target="_blank" rel="noopener">GitHub</a> | ||
<a href="https://fosstodon.org/@qunit" target="_blank" rel="noopener">Mastodon</a> | ||
|
||
<a href="https://twitter.com/qunitjs" target="_blank" rel="noopener">Twitter</a> | ||
|
||
<a href="https://gitter.im/qunitjs/qunit" target="_blank" rel="noopener">Chat</a> | ||
</p> | ||
<p class="copyright">Copyright <a href="https://openjsf.org/" target="_blank" rel="noopener">OpenJS Foundation</a> and contributors.<br><a href="https://github.com/qunitjs/qunit/blob/main/docs/QUnit/load.md">Edit this page</a></p> | ||
</div> | ||
</footer><script defer type="module" src="/assets/typesense-minibar.js?v=1d96e487"></script></body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.3.3">Jekyll</generator><link href="https://api.qunitjs.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://api.qunitjs.com/" rel="alternate" type="text/html" hreflang="en" /><updated>2024-03-02T19:28:10+00:00</updated><id>https://api.qunitjs.com/feed.xml</id><title type="html">QUnit</title><subtitle>The powerful, easy-to-use JavaScript testing framework.</subtitle></feed> | ||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.3.3">Jekyll</generator><link href="https://api.qunitjs.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://api.qunitjs.com/" rel="alternate" type="text/html" hreflang="en" /><updated>2024-03-02T22:28:53+00:00</updated><id>https://api.qunitjs.com/feed.xml</id><title type="html">QUnit</title><subtitle>The powerful, easy-to-use JavaScript testing framework.</subtitle></feed> |
Oops, something went wrong.