pending¶
pending marks an example as not yet implemented and records a human-readable reason. The example is registered, counted, and reported under the PENDING bucket in the runner output, but its body is not executed.
1 2 3 4 5 | |
The runner output for the above renders the description in blue and prints ⮑ PENDING underneath, and the final summary includes a N pending count alongside passes and failures.
Forms¶
pending has two forms:
1 2 | |
Both forms accept the same metadata keys as it (:tag, :tags, arbitrary :meta):
1 2 3 | |
pending vs xit¶
pending and xit both prevent the block from running, but they convey different intent and report under different buckets:
| block runs? | bucket | when to use | |
|---|---|---|---|
xit |
no | SKIPPED |
tests temporarily not relevant (broken fixture, env mismatch) |
pending |
no | PENDING |
functionality not yet implemented, with a written reason |
If you have functionality that should eventually work and you want a reminder, use pending. If you have a test that's noise or wrong for the current run, use xit.
Reading the reason¶
The reason is stored on the example as both the description and as pending-reason metadata:
1 2 3 | |
Tools that walk the spec tree can use the pending-reason metadata key to surface a TODO list of unfinished work alongside ordinary test results.