Skip to content

Commit

Permalink
Docs: Add example showcasing what modules do to test names
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Jul 18, 2024
1 parent 9992fa4 commit 4d672bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions docs/api/QUnit/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,20 @@ The module scope is given a `hooks` object which can be used to add [hooks](#hoo
Example:

```js
// Fruit > Berries > cowberry.
// Fruit > Berries > cranberry.
// Fruit > Melons > galia.
// Bread > bake.
// Bread > toast.
QUnit.module('Fruit', function (hooks) {
QUnit.module('Berries', function (hooks) {
QUnit.test('cranberry', function (assert) {
QUnit.test('cowberry', function (assert) {
assert.true(true);
});

// ...
QUnit.test('cranberry', function (assert) {
assert.true(true);
});
});

QUnit.module('Melons', function (hooks) {
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ These are the official release channels for QUnit releases:

## Further reading

* [Rad QUnit documentation offline](https://devdocs.io/qunit/), via DevDocs.
* [Read QUnit documentation offline](https://devdocs.io/qunit/), via DevDocs.
* [Introduction to JavaScript Unit Testing](https://coding.smashingmagazine.com/2012/06/introduction-to-javascript-unit-testing/), Jörn Zaefferer (2012).

0 comments on commit 4d672bc

Please sign in to comment.