The `testing/assert` docs only rendered a subset of `Assert` methods after the RST->Markdown conversion (bug 2038819).
In MyST Markdown a directive option (`:name: value`) must be on a single line. When the value wraps onto an indented continuation line, MyST silently drops the continuation into the directive body instead of the option. The `:members:` list for the `{js:autoclass} Assert` directive spanned three lines, so only the first line (`ok`..`notDeepEqual`) was passed as `:members:`; the remaining explicit members and, crucially, the `*` wildcard were dropped, which is why only a subset of methods appeared.
Fix: put the entire `:members:` list on one line. Verified with the MyST parser that the option now captures all 16 entries (including `*`) with no leftover body content.
Differential Revision: https://phabricator.services.mozilla.com/D316223
18 lines
723 B
Markdown
18 lines
723 B
Markdown
(assert-module)=
|
|
|
|
# Assert module
|
|
|
|
For XPCShell tests and mochitests, `Assert` is already present as an
|
|
instantiated global to which you can refer - you don't need to construct it
|
|
yourself. You can immediately start using `Assert.ok` and similar methods as
|
|
test assertions.
|
|
|
|
The full class documentation follows, but it is perhaps worth noting that this
|
|
API is largely identical to
|
|
[NodeJS' assert module](https://nodejs.org/api/assert.html), with some
|
|
omissions/changes including strict mode and string matching.
|
|
|
|
```{js:autoclass} Assert
|
|
:members: ok, equal, notEqual, strictEqual, notStrictEqual, deepEqual, notDeepEqual, greater, less, greaterOrEqual, lessOrEqual, stringContains, stringMatches, throws, rejects, *
|
|
```
|