-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use GuiceOneAppPerSuite with async tests #112
Comments
GuiceOneAppPerSuite
with async tests
Looking to do the same. Any suggestions? |
Hi @dpoetzsch, Thanks for investigating this. Another solution is to declare trait GuiceOneAppPerSuite extends BaseOneAppPerSuite with GuiceFakeApplicationFactory {
this: org.scalatest.Suite =>
} That way, it should work when you mix Best. |
For those looking for a quick hack, you can declare the async suite as a nested suite: import org.scalatest._
import org.scalatestplus.play.guice.GuiceOneAppPerSuite
import scala.collection.immutable
class GuiceOneAppPerAsyncSuite extends TestSuite with GuiceOneAppPerSuite {
val nestedSuite = new AsyncFlatSpec {
// async tests here
}
override def nestedSuites: immutable.IndexedSeq[Suite] = Vector(nestedSuite)
} |
@marcospereira I'm also no Scala magician, but I was trying out your suggestion above to attempt this: trait GuiceOneAppPerSuite extends BaseOneAppPerSuite with GuiceFakeApplicationFactory {
this: org.scalatest.Suite =>
} It seems like that won't work because |
this allows implementing specs to use either sync or async suites
took at crack at this, moved TestSuite/TestSuiteMixin to Suite/SuiteMixin: #255 |
for app and server fixtures. fixes playframework#111, and also doesn't start app/server if test is excluded via tags
AsyncSpec does not work for some reason... Here's a couple of workaround for future review playframework/scalatestplus-play#112
AsyncSpec does not work for some reason... Here's a couple of workaround for future review playframework/scalatestplus-play#112
* Implemented UserService that can be tested * Scalatest for UserService AsyncSpec does not work for some reason... Here's a couple of workaround for future review playframework/scalatestplus-play#112
I have a async test suite that extends
AsyncFunSpec
.Now, it seems to be not possible to also mix-in
GuiceOneAppPerSuite
:I am no scala magician, but I figure this is because
GuiceOneAppPerSuite
demandsTestSuite
whileAsyncFunSpec
inherits fromAsyncTestSuite
.I figure an easy workaround would be to have an (otherwise identical)
GuiceOneAppPerSuiteAsync
that uses theAsyncTestSuite
inheritance tree as follows:Is there an easier way? And if not, should I create a pull request to add these traits?
The text was updated successfully, but these errors were encountered: