-
Notifications
You must be signed in to change notification settings - Fork 780
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: Write a page for
QUnit.config.modules
Used by HTML Reporter, and by plugins such as `steal-qunit`. Ref #1118
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
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
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,39 @@ | ||
--- | ||
layout: page-api | ||
title: QUnit.config.modules | ||
excerpt: List of defined test modules. | ||
groups: | ||
- config | ||
- extension | ||
version_added: "1.16.0" | ||
--- | ||
|
||
List of defined test modules. | ||
|
||
<table> | ||
<tr> | ||
<th>type</th> | ||
<td markdown="span">`Array<Module>` (read-only)</td> | ||
</tr> | ||
</table> | ||
|
||
This property is exposed under `QUnit.config` for use by plugins and other integrations. It returns an array of internal `Module` objects, one for each call to [`QUnit.module()`](../QUnit/module.md). | ||
|
||
Before accessing this property, wait for the [`QUnit.on('runStart')`](../callbacks/QUnit.on.md#the-runstart-event) event, or use a [`QUnit.begin()`](../callbacks/QUnit.begin.md) callback. | ||
|
||
### Module object | ||
|
||
The following properties are considered publicly supported: | ||
|
||
| property | description | | ||
|-----------|-------------| | ||
| `name` (string) | Module name, as passed to [`QUnit.module()`](../QUnit/module.md). | ||
| `moduleId` (string) | Hashed identifier, for the [QUnit.config.moduleId](./moduleId.md) filter. | ||
|
||
## Example | ||
|
||
```js | ||
QUnit.on('runStart', () => { | ||
console.log(QUnit.config.modules.map(mod => mod.name)); | ||
}); | ||
``` |