Skip to content

Commit bb9c8f0

Browse files
committed
Docs: Minor improvements caught during review of 3.0 Upgrade Guide
Ref #1808.
1 parent b3516a7 commit bb9c8f0

File tree

12 files changed

+32
-43
lines changed

12 files changed

+32
-43
lines changed

History.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@
33

44
### Added
55

6+
* Release: Add native ESM distribution, used automatically by Node.js when using the `import` keyword. [#1551](https://github.com/qunitjs/qunit/issues/1551)
67
* Core: Add module context to `before` and `after` hooks. This enables inheritance between parent and child modules, and fixes leaks between last test and `after` hooks. (Ray Cohen) [#1328](https://github.com/qunitjs/qunit/issues/1328)
78
* Core: Add [`QUnit.config.reporters.html`](https://qunitjs.com/api/config/reporters/) for disabling the HTML Reporter. [#1711](https://github.com/qunitjs/qunit/issues/1711)
89
* Core: Export [`QUnit.urlParams`](https://qunitjs.com/api/extension/QUnit.urlParams/) unconditionally. [57c2dbcffc](https://github.com/Krinkle/qunit/commit/57c2dbcffc694bf3a0b5d1d57e7f43f16ff29862)
910
* Core: Export `QUnit` global unconditionally. [#1771](https://github.com/qunitjs/qunit/pull/1771)
10-
* Release: Add native ESM distribution. [#1551](https://github.com/qunitjs/qunit/issues/1551)
11-
12-
This introduces an ESM distribution (`qunit/esm/qunit.module.js`), alongside the existing `qunit/qunit.js` file in the CJS format. Both are available for [download](https://releases.jquery.com/qunit/).
13-
14-
Browser support for the CJS format is the same as in QUnit 2.x (including IE 9-11 and Safari 7+). If you choose to opt-in to the ESM format, note that this does not support running tests in IE 9-11 or Safari 7-9.
15-
16-
When testing in Node.js, we automatically select a format based on `require()` vs `import`. Both share the same instance internally so mixed usage is okay. If some configuration files, plugins, adapters, test runners, or tests import QUnit differently, everything still works fine.
1711

1812
### Changed
1913

@@ -23,17 +17,17 @@
2317
* Core: Promote warning "[Unexpected test after runEnd](https://qunitjs.com/api/config/autostart/#E0001)" to error. [#1377](https://github.com/qunitjs/qunit/issues/1377)
2418
* Core: Promote "No tests were run." from fake test to native error. [#1790](https://github.com/qunitjs/qunit/pull/1790)
2519
* Assert: Change [`assert.expect()`](https://qunitjs.com/api/assert/expect/) to exclude `assert.step()` calls from count. (Kyle Simpson) [#1226](https://github.com/qunitjs/qunit/issues/1226)
26-
* HTML Reporter: New theme design and structure. Before and after demo in [#1774](https://github.com/qunitjs/qunit/pull/1774).
27-
* Add support for displaying early errors in the UI. [#1786](https://github.com/qunitjs/qunit/pull/1786)
28-
* Add `user-select: none;` to "Rerun" link and "runtime" indicator. [6becc199e0](https://github.com/qunitjs/qunit/commit/6becc199e0)
29-
* Add `running` class to test items. [1551120536](https://github.com/qunitjs/qunit/commit/1551120536f6f572a3bb5656db566f0a1bb217d8)
20+
* HTML Reporter: New design with fresh color palette and improved color contrast. View demos in [#1774](https://github.com/qunitjs/qunit/pull/1774).
21+
* Faster UI rendering, now instantly instead of after DOM-ready. [#1793](https://github.com/qunitjs/qunit/pull/1793)
22+
* Faster headless execution, when [`id=qunit` element](https://qunitjs.com/browser/) does not exist. [#1711](https://github.com/qunitjs/qunit/issues/1711)
23+
* Add support for displaying early errors. [#1786](https://github.com/qunitjs/qunit/pull/1786)
24+
* Change assertion count in toolbar to test count. [#1760](https://github.com/qunitjs/qunit/pull/1760)
3025
* Change `#qunit-banner` from H2 to DIV, to fix WCAG compliance. [#1427](https://github.com/qunitjs/qunit/issues/1427)
3126
* Change `#qunit-testresult` from P to DIV, to fix HTML serialization. [#1301](https://github.com/qunitjs/qunit/issues/1301)
32-
* Change run time in toolbar from milliseconds to seconds. [#1760](https://github.com/qunitjs/qunit/pull/1760)
33-
* Faster UI rendering, now instantly instead of after DOM-ready. [#1793](https://github.com/qunitjs/qunit/pull/1793)
27+
* Change runtime in toolbar from milliseconds to seconds. [#1760](https://github.com/qunitjs/qunit/pull/1760)
28+
* Fix text selection to exclude "Rerun" link. [6becc199e0](https://github.com/qunitjs/qunit/commit/6becc199e0)
3429
* Fix overflow and scrollbar issues. [#1603](https://github.com/qunitjs/qunit/issues/1603)
35-
* Fix HTML Reporter to have no overhead when no [`id=qunit` element](https://qunitjs.com/browser/) exists. [#1711](https://github.com/qunitjs/qunit/issues/1711)
36-
* Remove assertion count from toolbar in favor of test count. [#1760](https://github.com/qunitjs/qunit/pull/1760)
30+
* Fix adding `running` class to test items. [1551120536](https://github.com/qunitjs/qunit/commit/1551120536f6f572a3bb5656db566f0a1bb217d8)
3731

3832
### Fixed
3933

@@ -47,7 +41,7 @@
4741

4842
* Core: Remove support for Node.js 10-16. Node.js 18 or later is required. (NullVoxPopuli) [#1727](https://github.com/qunitjs/qunit/issues/1727)
4943
* Core: Remove support for PhantomJS. (Steve McClure) [#1505](https://github.com/qunitjs/qunit/pull/1505)
50-
* Core: Remove built-in export for AMD. You can still load your application and your QUnit tests with AMD/RequireJS. This only affects the loading of the qunit.js file itself. [Example: Loading with RequireJS](https://qunitjs.com/api/config/autostart/#loading-with-requirejs). (NullVoxPopuli) [#1729](https://github.com/qunitjs/qunit/issues/1729)
44+
* Core: Remove built-in export for AMD. You can continue to load your application and your QUnit tests with AMD/RequireJS. This change only affects the loading of the qunit.js file itself. [Example: Loading with RequireJS](https://qunitjs.com/api/config/autostart/#loading-with-requirejs). (NullVoxPopuli) [#1729](https://github.com/qunitjs/qunit/issues/1729)
5145
* Core: Remove deprecated [`QUnit.load()`](https://qunitjs.com/api/QUnit/load/). [#1084](https://github.com/qunitjs/qunit/issues/1084)
5246
* Core: Remove deprecated `QUnit.onError()` and `QUnit.onUnhandledRejection()` in favor of [`QUnit.onUncaughtException()`](https://qunitjs.com/api/extension/QUnit.onUncaughtException/).
5347
* Core: Remove undocumented `details.modules[].tests` from QUnit.begin() event.

docs/_posts/2020-11-29-qunit-2-13-0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Thanks Steve McClure, Stephen Yeung, and brandonocasey for their contributions!
1919

2020
### Deprecated
2121

22-
* HTML Reporter: Deprecate PhantomJS. (Steve McClure)
22+
* HTML Reporter: Deprecate PhantomJS. (Steve McClure) [#1505](https://github.com/qunitjs/qunit/pull/1505)
2323

2424
### Fixed
2525

docs/_sass/custom.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ h3 a {
107107
}
108108
}
109109

110+
.content li {
111+
margin: 0.5em 0;
112+
}
113+
110114
.content a.footnote {
111115
text-decoration: none;
112116
}

docs/api/QUnit/test.each.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page-api
33
title: QUnit.test.each()
4-
excerpt: Add tests using a data provider.
4+
excerpt: Define tests using a data provider.
55
groups:
66
- main
77
redirect_from:

docs/api/QUnit/test.if.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page-api
33
title: QUnit.test.if()
4-
excerpt: Add a test that may be skipped.
4+
excerpt: Define a test that is automatically skipped when a condition is false.
55
groups:
66
- main
77
redirect_from:
@@ -11,7 +11,7 @@ version_added: "2.22.0"
1111

1212
`QUnit.test.if( name, condition, callback )`
1313

14-
Add a test that only runs if a condition is true.
14+
Define a test that is automatically skipped when a condition is false.
1515

1616
| parameter | description |
1717
|-----------|-------------|
@@ -21,7 +21,7 @@ Add a test that only runs if a condition is true.
2121

2222
If the condition is true, this is equivalent to calling [`QUnit.test()`](./test.md).
2323

24-
If the conditional is false, this is equivalent to calling [`QUnit.test.skip()`](./test.skip.md), and test will not run. Instead, it will be listed in the results as a "skipped" test.
24+
If the conditional is false, this is equivalent to calling [`QUnit.test.skip()`](./test.skip.md), and the test will not run. Instead, it will be listed in the results as a "skipped" test.
2525

2626
Use cases:
2727
* Skip tests for a feature not supported in an older browser, when cross-browser testing in CI.

docs/api/QUnit/test.only.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page-api
33
title: QUnit.test.only()
4-
excerpt: Add a test that is exclusively run.
4+
excerpt: Define a test that is exclusively run.
55
groups:
66
- main
77
redirect_from:
@@ -14,7 +14,7 @@ version_added: "1.20.0"
1414
`QUnit.test.only( name, callback )`<br>
1515
`QUnit.only( name, callback )`
1616

17-
Add a test that is exclusively run, preventing other tests from running unless they are also defined in this way.
17+
Define a test that is exclusively run, preventing other tests from running unless they are also defined in this way.
1818

1919
| parameter | description |
2020
|-----------|-------------|

docs/api/QUnit/test.skip.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page-api
33
title: QUnit.test.skip()
4-
excerpt: Add a test that will be skipped.
4+
excerpt: Define a test that will be skipped.
55
groups:
66
- main
77
redirect_from:
@@ -16,7 +16,7 @@ version_added: "1.16.0"
1616
`QUnit.skip( name )`<br/>
1717
`QUnit.skip( name, callback )`
1818

19-
Add a test that will be skipped during the run.
19+
Define a test that will be skipped during the run.
2020

2121
| parameter | description |
2222
|-----------|-------------|

docs/api/QUnit/test.todo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page-api
33
title: QUnit.test.todo()
4-
excerpt: Add a test which expects at least one failing assertion.
4+
excerpt: Define a test that is not yet expected to pass.
55
groups:
66
- main
77
redirect_from:
@@ -14,7 +14,7 @@ version_added: "2.2.0"
1414
`QUnit.test.todo( name, callback )`<br>
1515
`QUnit.todo( name, callback )`
1616

17-
Add a test which expects at least one failing assertion or exception during its run.
17+
Define a test that is not yet expected to pass, because the test has one or more failing assertions or throws an exception.
1818

1919
| parameter | description |
2020
|-----------|-------------|

docs/api/assert/rejects.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ async function feedBaby (food) {
5151
}
5252

5353
QUnit.test('example', async function (assert) {
54-
await assert.rejects(
55-
feedBaby('sprouts'),
56-
RangeError
57-
);
54+
assert.true(feedBaby('apple'));
55+
56+
await assert.rejects(feedBaby('sprouts'), RangeError);
57+
58+
assert.true(feedBaby('cucumber'), RangeError);
5859
});
5960
```
6061

docs/api/assert/timeout.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page-api
33
title: assert.timeout()
4-
excerpt: How long to wait for async operations.
4+
excerpt: How long a test may spend in async operations.
55
groups:
66
- assert
77
- async
@@ -12,7 +12,7 @@ version_added: "2.4.0"
1212

1313
`timeout( duration )`
1414

15-
Set how long to wait for async operations to finish.
15+
Set how long a test may wait for async operations to finish.
1616

1717
| name | description |
1818
|------|-------------|

0 commit comments

Comments
 (0)