Initialize the `is` testing helper
masterTo use is, you must first create a new instance of the testing helper using is.New(t) or is.NewRelaxed(t). You should always start your tests with this initialization.
There are two modes of operation:
- Strict Mode (
is.New): When an assertion fails, it callst.FailNow(), which immediately aborts the current test. This is the recommended mode for most tests. - Relaxed Mode (
is.NewRelaxed): When an assertion fails, it callst.Fail(), allowing the test to continue executing. This is useful if you want to report multiple failures within a single test function.
func Test(t *testing.T) {
// always start tests with this
is := is.New(t)
// ... assertions ...
}