ory / dockertest

Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=dockertest
Apache License 2.0
4.15k stars 243 forks source link

test: refactor asserts #497

Closed alexandear closed 4 months ago

alexandear commented 7 months ago

Replace require.Nil/require.NotNil with more idiomatic require.NoError/require.Error. Reverse actual and expected values in a few test asserts.

Related Issue or Design Document

Checklist

Further comments

This is found with the help of testifylint.

Running log ``` dockertest_test.go:45:2: error-nil: use require.NoError (testifylint) dockertest_test.go:57:2: error-nil: use require.NoError (testifylint) dockertest_test.go:58:2: error-nil: use require.NoError (testifylint) dockertest_test.go:70:2: error-nil: use require.NoError (testifylint) dockertest_test.go:86:2: error-nil: use require.NoError (testifylint) dockertest_test.go:87:2: error-nil: use require.NoError (testifylint) dockertest_test.go:97:2: error-nil: use require.NoError (testifylint) dockertest_test.go:108:2: error-nil: use require.NoError (testifylint) dockertest_test.go:110:2: error-nil: use require.NoError (testifylint) dockertest_test.go:120:2: error-nil: use require.NoError (testifylint) dockertest_test.go:123:2: error-nil: use require.NoError (testifylint) dockertest_test.go:138:2: error-nil: use require.NoError (testifylint) dockertest_test.go:141:2: error-nil: use require.NoError (testifylint) dockertest_test.go:154:2: error-nil: use require.NoError (testifylint) dockertest_test.go:158:2: error-nil: use require.NoError (testifylint) dockertest_test.go:161:2: error-nil: use require.NoError (testifylint) dockertest_test.go:173:2: error-nil: use require.NoError (testifylint) dockertest_test.go:177:2: error-nil: use require.NoError (testifylint) dockertest_test.go:180:2: error-nil: use require.NoError (testifylint) dockertest_test.go:193:2: error-nil: use require.NoError (testifylint) dockertest_test.go:196:2: error-nil: use require.NoError (testifylint) dockertest_test.go:210:2: error-nil: use require.NoError (testifylint) dockertest_test.go:213:2: error-nil: use require.NoError (testifylint) dockertest_test.go:243:2: error-nil: use require.NoError (testifylint) dockertest_test.go:250:2: error-nil: use require.NoError (testifylint) dockertest_test.go:252:2: expected-actual: need to reverse actual and expected values (testifylint) dockertest_test.go:253:2: error-nil: use require.NoError (testifylint) dockertest_test.go:258:2: error-nil: use require.NoError (testifylint) dockertest_test.go:273:3: error-nil: use require.NoError (testifylint) dockertest_test.go:276:3: error-nil: use require.Error (testifylint) dockertest_test.go:279:2: error-nil: use require.NoError (testifylint) dockertest_test.go:281:2: error-nil: use require.NoError (testifylint) dockertest_test.go:294:2: error-nil: use require.NoError (testifylint) dockertest_test.go:297:2: error-nil: use require.NoError (testifylint) dockertest_test.go:308:2: error-nil: use require.NoError (testifylint) dockertest_test.go:313:2: expected-actual: need to reverse actual and expected values (testifylint) dockertest_test.go:315:2: error-nil: use require.NoError (testifylint) dockertest_test.go:326:2: error-nil: use require.NoError (testifylint) dockertest_test.go:329:2: error-nil: use require.NoError (testifylint) dockertest_test.go:337:2: error-nil: use require.NoError (testifylint) dockertest_test.go:338:2: error-nil: use require.NoError (testifylint) dockertest_test.go:343:2: error-nil: use require.NoError (testifylint) dockertest_test.go:357:2: error-nil: use require.NoError (testifylint) dockertest_test.go:364:2: error-nil: use require.NoError (testifylint) dockertest_test.go:372:2: error-nil: use require.NoError (testifylint) dockertest_test.go:381:2: error-nil: use require.NoError (testifylint) dockertest_test.go:390:2: error-nil: use require.NoError (testifylint) dockertest_test.go:407:2: error-nil: use require.NoError (testifylint) dockertest_test.go:412:2: error-nil: use require.NoError (testifylint) dockertest_test.go:416:2: error-nil: use require.NoError (testifylint) dockertest_test.go:420:2: error-nil: use require.NoError (testifylint) dockertest_test.go:423:2: error-nil: use require.NoError (testifylint) dockertest_test.go:427:2: error-nil: use require.NoError (testifylint) dockertest_test.go:443:2: error-nil: use require.NoError (testifylint) dockertest_test.go:450:2: error-nil: use require.NoError (testifylint) dockertest_test.go:483:2: error-nil: use require.NoError (testifylint) dockertest_test.go:485:2: error-nil: use require.NoError (testifylint) dockertest_test.go:488:2: error-nil: use require.NoError (testifylint) ```
alnr commented 4 months ago

This is a good improvements. Would you mind rebasing?