`t.Error(err)` should work, I think.