# Use Sorbet compatible setup-initializations in tests Sorbet can help with type inference in tests if the setup is right. Otherwise types will be reduced to `T.untyped`. ## Don't do ```ruby class Test < ActiveSupport::TestCase def setup # Don't use `dev setup`. @user = make_fixture(User, :alex) # Don't forget `T.let` end end ``` ## Do ```ruby class Test < ActiveSupport::TestCase setup do @user = T.let(make_fixture(User, :alex), User) end end ``` With this latter `@user` will be infered as type `User`, and it does not need to be nilable.