Skip to content

Stop using require.New and assert.New

Jacob Vosmaer requested to merge jv-assert-require-new into master

Our test library github.com/stretchr/testify has two different calling conventions:

require.Equal(t, foo, bar)

And:

require := require.New(t) // shadow the 'require' package with a 'require' variable
require.Equal(foo, bar)

We currently mix these two conventions. I think it would be better to settle on one. I think the one where you pass in t every time is simpler. It is also nicer to use with t.Run because you don't have to write require := require.New(t) a second time inside your t.Run function.

Merge request reports