Skip to content

Commit

Permalink
Build commit 3332800
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Mar 2, 2024
1 parent 1446539 commit eb380c4
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 8 deletions.
166 changes: 166 additions & 0 deletions QUnit/load/index.html
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&#39;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>
31 changes: 27 additions & 4 deletions QUnit/start/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,34 @@ <h1>QUnit.start()</h1>
<h2 id="description" class="screen-reader-text h-api-desc">Description</h2>
<p><code class="language-plaintext highlighter-rouge">QUnit.start()</code></p>

<p>Start the test runner manually, when <a href="/config/autostart/"><code class="language-plaintext highlighter-rouge">QUnit.config.autostart</code></a> is <code class="language-plaintext highlighter-rouge">false</code>. For example, if you load test files with AMD, RequireJS, or ESM dynamic imports.</p>
<p>Call this method to start the test runner. This indicates that all relevant source code has been loaded and all tests have been defined.</p>

<p>Note: See <a href="/config/autostart/"><code class="language-plaintext highlighter-rouge">QUnit.config.autostart</code></a> for detailed examples of how to use this.</p>
<p>In most environments this is <strong>automatically called</strong> and you do not need to call it. This includes testing via the HTML Runner and the QUnit CLI.</p>

<p class="note note--warning"><strong>Warning</strong>: Prior to QUnit 1.16, this method was used for resuming an async <code class="language-plaintext highlighter-rouge">QUnit.start</code> function, as complement to <code class="language-plaintext highlighter-rouge">QUnit.stop()</code>. To resume asynchronous tests, use <a href="/assert/async/"><code class="language-plaintext highlighter-rouge">assert.async()</code></a> instead.</p>
<p>If you build a custom test runner (such in SpiderMonkey or Node.js), or if you disable <code class="language-plaintext highlighter-rouge">QUnit.config.autostart</code> and load test files asynchronously (with AMD, RequireJS, or ESM dynamic imports), then you need to call this once after your test files have been loaded.</p>

<p>See <a href="/config/autostart/"><code class="language-plaintext highlighter-rouge">QUnit.config.autostart</code></a> for detailed examples of how to use <code class="language-plaintext highlighter-rouge">QUnit.start()</code>.</p>

<p class="note note--warning">Prior to QUnit 1.16, this method was used for resuming an async <code class="language-plaintext highlighter-rouge">QUnit.test()</code> function, as complement to <code class="language-plaintext highlighter-rouge">QUnit.stop()</code>. To resume asynchronous tests, use <a href="/assert/async/"><code class="language-plaintext highlighter-rouge">assert.async()</code></a> instead.</p>

<h2 id="changelog">Changelog</h2>

<table>
<tbody>
<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 <a href="/QUnit/load/"><code class="language-plaintext highlighter-rouge">QUnit.load()</code></a> first.</td>
</tr>
<tr>
<td><a href="https://github.com/qunitjs/qunit/releases/tag/2.0.0">QUnit 2.0</a></td>
<td>Support for calling <code class="language-plaintext highlighter-rouge">start()</code> to resume an async test was removed. (<a href="https://qunitjs.com/upgrade-guide-2.x/#introducing-assertasync">Migration guide</a>)</td>
</tr>
<tr>
<td><a href="https://github.com/qunitjs/qunit/releases/tag/1.16.0">QUnit 1.16</a></td>
<td>Use of <code class="language-plaintext highlighter-rouge">start()</code> to resume an async test was deprecated in favour of <a href="/assert/async/"><code class="language-plaintext highlighter-rouge">assert.async()</code></a>.</td>
</tr>
</tbody>
</table>

</article>
</div>
Expand Down Expand Up @@ -121,7 +144,7 @@ <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></ol></div>
<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></ol></div>
</aside>

</div>
Expand Down
8 changes: 6 additions & 2 deletions assert/async/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ <h2 id="description" class="screen-reader-text h-api-desc">Description</h2>

<p><code class="language-plaintext highlighter-rouge">assert.async()</code> returns a callback function and pauses test processing until the callback function is called. The callback will throw an <code class="language-plaintext highlighter-rouge">Error</code> if it is invoked more often than the required call count.</p>

<p>This replaces functionality previously provided by <code class="language-plaintext highlighter-rouge">QUnit.stop()</code> and <a href="/QUnit/start/"><code class="language-plaintext highlighter-rouge">QUnit.start()</code></a>.</p>
<h2 id="see-also">See also</h2>

<ul>
<li><a href="https://qunitjs.com/upgrade-guide-2.x/#introducing-assertasync">Migration guide</a> from QUnit 1.x <code class="language-plaintext highlighter-rouge">stop()</code> and <code class="language-plaintext highlighter-rouge">start()</code>.</li>
</ul>

<h2 id="examples">Examples</h2>

Expand Down Expand Up @@ -235,7 +239,7 @@ <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="#examples">Examples</a><ol><li class="sidebar-item"><a href="#wait-for-callback">Wait for callback</a></li><li class="sidebar-item"><a href="#wait-for-multiple-callbacks">Wait for multiple callbacks</a></li><li class="sidebar-item"><a href="#require-multiple-calls">Require multiple calls</a></li></ol></li></ol></div>
<h4>Table of contents</h4><ol class="toc"><li class="sidebar-item"><a href="#description">Description</a></li><li class="sidebar-item"><a href="#see-also">See also</a></li><li class="sidebar-item"><a href="#examples">Examples</a><ol><li class="sidebar-item"><a href="#wait-for-callback">Wait for callback</a></li><li class="sidebar-item"><a href="#wait-for-multiple-callbacks">Wait for multiple callbacks</a></li><li class="sidebar-item"><a href="#require-multiple-calls">Require multiple calls</a></li></ol></li></ol></div>
</aside>

</div>
Expand Down
3 changes: 3 additions & 0 deletions deprecated/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ <h1>Deprecated methods</h1>
<h2 id="qunit-extend"><a href="/extension/QUnit.extend/">QUnit.extend()</a></h2>
<p><strong>DEPRECATED</strong> Copy the properties from one object into a target object.</p>

<h2 id="qunit-load"><a href="/QUnit/load/">QUnit.load()</a></h2>
<p><strong>DEPRECATED</strong> Inform the test runner that code has finished loading.</p>

<h2 id="qunit-push"><a href="/extension/QUnit.push/">QUnit.push()</a></h2>
<p><strong>DEPRECATED</strong> Report the result of a custom assertion.</p>

Expand Down
2 changes: 1 addition & 1 deletion feed.xml
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>
Loading

0 comments on commit eb380c4

Please sign in to comment.