Skip to content

Commit dbaf18f

Browse files
committed
Document areas where GinkgoT() behaves differently from testing.T
adresses #1331
1 parent 6f67a14 commit dbaf18f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/index.md

+5
Original file line numberDiff line numberDiff line change
@@ -5480,6 +5480,11 @@ When using Gomock you may want to run `ginkgo` with the `-trace` flag to print o
54805480
54815481
Similarly for third party libraries which accept a `testing.TB` interface, use the `GinkgoTB()` function. This function returns a struct wrapper around `GinkgoT()` which satisfies the `testing.TB`interface. If you need to use any Ginkgo-specific methods you can access the wrapped `GinkgoT()` instance using `GinkgoTBWrapper.GinkgoT`.
54825482
5483+
In general, `GinkgoT()` attempts to mimic the behavior of `testing.T` with the exception of the following:
5484+
5485+
- `Error`/`Errorf`: failures in Ginkgo always immediately stop execution and there is no mechanism to log a failure without aborting the test. As such `Error`/`Errorf` are equivalent to `Fatal`/`Fatalf`.
5486+
- `Parallel()` is a no-op as Ginkgo's multi-process parallelism model is substantially different from go test's in-process model.
5487+
54835488
### IDE Support
54845489
Ginkgo works best from the command-line, and [`ginkgo watch`](#watching-for-changes) makes it easy to rerun tests on the command line whenever changes are detected.
54855490

ginkgo_t_dsl.go

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ GinkgoT() is analogous to *testing.T and implements the majority of *testing.T's
1515
GinkgoT() takes an optional offset argument that can be used to get the
1616
correct line number associated with the failure - though you do not need to use this if you call GinkgoHelper() or GinkgoT().Helper() appropriately
1717
18+
GinkgoT() attempts to mimic the behavior of `testing.T` with the exception of the following:
19+
20+
- Error/Errorf: failures in Ginkgo always immediately stop execution and there is no mechanism to log a failure without aborting the test. As such Error/Errorf are equivalent to Fatal/Fatalf.
21+
- Parallel() is a no-op as Ginkgo's multi-process parallelism model is substantially different from go test's in-process model.
22+
1823
You can learn more here: https://onsi.github.io/ginkgo/#using-third-party-libraries
1924
*/
2025
func GinkgoT(optionalOffset ...int) FullGinkgoTInterface {

0 commit comments

Comments
 (0)