Skip to content

Commit afedada

Browse files
committed
Clarify state is the failed state
1 parent 1e12c7d commit afedada

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

lib/ex_unit/lib/ex_unit.ex

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ defmodule ExUnit do
6262
"""
6363

6464
@typedoc """
65-
All tests start with a state of `nil`.
65+
The state of a test.
6666
67-
A finished test can be in one of five states:
67+
It is meant to reflect whenever a test did not run
68+
or fail. It may be one of five states:
6869
6970
1. Passed (also represented by `nil`)
7071
2. Failed
@@ -76,12 +77,12 @@ defmodule ExUnit do
7677
@type state ::
7778
nil
7879
| {:excluded, binary}
79-
| {:failed, failed}
80+
| {:failed, errors}
8081
| {:invalid, ExUnit.TestModule.t()}
8182
| {:skipped, binary}
8283

83-
@typedoc "The error state returned by `ExUnit.Test` and `ExUnit.TestModule`"
84-
@type failed :: [{Exception.kind(), reason :: term, Exception.stacktrace()}]
84+
@typedoc "The errors returned by `ExUnit.Test` and `ExUnit.TestModule`"
85+
@type errors :: [{Exception.kind(), reason :: term, Exception.stacktrace()}]
8586

8687
@typedoc "A map representing the results of running a test suite"
8788
@type suite_result :: %{
@@ -147,7 +148,7 @@ defmodule ExUnit do
147148
which is truncated and hashed when above 250 characters
148149
* `:module` - the test module
149150
* `:description` - the test description (the name without truncation)
150-
* `:state` - the finished test state (see `t:ExUnit.state/0`)
151+
* `:state` - the failed state of the test after it runs (see `t:ExUnit.state/0`)
151152
* `:time` - the duration in microseconds of the test's runtime
152153
* `:tags` - the test tags
153154
* `:logs` - the captured logs
@@ -194,7 +195,7 @@ defmodule ExUnit do
194195
195196
* `:setup_all?` - (since v1.18.0) if the test module requires a setup all
196197
197-
* `:state` - the test error state (see `t:ExUnit.state/0`)
198+
* `:state` - the failed state of `setup_all` after it runs (see `t:ExUnit.state/0`)
198199
199200
* `:tags` - all tags in this module
200201

0 commit comments

Comments
 (0)