测试框架jasmine提供junit了在每次测试运行之前配置测试环境的方法。scalatest和中有类似的东西吗playspec?
在 scalatest 中,您可以使用特征BeforeAndAfterAll并BeforeAndAfterEach添加此类方法,然后您需要覆盖它们:
class BaseTest extends FlatSpec with BeforeAndAfterAll with BeforeAndAfterEach{
override def beforeAll(): Unit = {
super.beforeAll()
//your logic here
}
//..
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2935 次 |
| 最近记录: |