v1.7.0
New features:
- new (*td.T).RunAssertRequire function. Useful to avoid boilerplate code:
t.RunAssertRequire("GetAge", func (assert *td.T, require *td.T) { age, err := GetAge("Bob") require.CmpNoError(err) assert.Cmp(age, 42) })
- new tdhttp.TestAPI method Or(), useful to debug a test failure:
see the Or() documentation as the passed function can have a much more complex signature. It is inspired by Test::Mojo or() method and allows to easily inspect the response of the requested API when the checks fail.
ta.Get("/person/42", "Accept", "application/json"). CmpJSONBody(td.JSON(`{"id": $1, "name": "Bob"}`, td.NotZero())). Or(func (body string) { t.Logf("received unexpected body: <%s>", body) })
Fixes:
- #101 → some data recursion cases were not correctly handled (reported and tested by @stewi1014);
- some panics due to the user misbehavior were not properly red-colored;
- (*td.T).Run:
t.Config
is now copied instead of shared before using it in sub-func; - typos in doc.
Enjoy!