Files
Sylvestre Ledru 621bde39bf bug 2060240 - Put the Assert autoclass :members: list on a single line so all members are documented r=firefox-source-docs-reviewers,ahal DONTBUILD
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
2026-08-07 16:00:06 +00:00

723 B

(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, with some omissions/changes including strict mode and string matching.

:members: ok, equal, notEqual, strictEqual, notStrictEqual, deepEqual, notDeepEqual, greater, less, greaterOrEqual, lessOrEqual, stringContains, stringMatches, throws, rejects, *