Skip to content

Commit ea2f54c

Browse files
fixup!: update API doc to be less "why", just "what"
1 parent 502ab40 commit ea2f54c

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

doc/api/test.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -231,25 +231,11 @@ added:
231231
- REPLACEME
232232
-->
233233

234-
These are tests written to otherwise pass but there is some issue (often
235-
upstream) causing them to fail. Rather than using `skip` or `todo`, which would
236-
effectively silence the failure, the test would instead be marked `xfail` (`x`
237-
from "expected" + `fail`). That way, when the issue is resolved, that is
238-
explicitly surfaced.
234+
This flips the pass/fail reporting for a specific test or suite: A flagged test/test-case must throw
235+
in order to "pass"; a test/test-case that does not throw, fails.
239236

240-
The test would normally be written:
241-
242-
```js
243-
it('should do the thing', () => {
244-
assert.strictEqual(doTheThing(), true);
245-
});
246-
247-
it('should do the thing', () => {
248-
assert.strictEqual(doTheThing(), true);
249-
});
250-
```
251-
252-
But for whatever reason, `doTheThing` is not and _currently_ cannot return `true`.
237+
In the following, `doTheThing()` returns _currently_ `false` (`false` does not equal `true`, causing
238+
`strictEqual` to throw, so the test-case passes).
253239

254240
```js
255241
it.xfail('should do the thing', () => {

0 commit comments

Comments
 (0)