Test frameworks like jasmine and junit provide ways to configure the test environment before each test is run. Is something similar available in scalatest and playspec?
In scalatest you can use traits BeforeAndAfterAll and BeforeAndAfterEach to add such methods, then you need to override them fe:
class BaseTest extends FlatSpec with BeforeAndAfterAll with BeforeAndAfterEach{
override def beforeAll(): Unit = {
super.beforeAll()
//your logic here
}
//..
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With