scala - run scala test from Intellij
问题描述
Below is the main class :
object HelloWorld {
def hello() = "Hello "
}
Below is test suite:
import org.scalatest.{Matchers, FunSuite}
class HelloWorldTest extends FunSuite with Matchers {
test("Say Hi!") {
HelloWorld.hello() should be ("Hello, World!")
}
}
I wanted to run the test cases from Intellij. I tried configuration type ScalaTest and Application and the configuration package does not appear to select.
How to run the test cases from Intellij
解决方案
不确定我是否正确,但您可以通过多种方式做到这一点:
- 右键单击 HelloWorldTest 并选择运行
- 右键单击项目文件树上的文件名,然后单击运行
- 您可以在工具栏中选择运行 => 编辑配置 => + 在左侧 => ScalaTest => 给它一个名称并在“测试类:”中编写 HelloWorldTest => 好的,然后再次运行并运行并选择您提供的名称它
推荐阅读
- sql-server - Visual Studio:使用网格视图更新 2 个表
- django - django - 测量中间件中的延迟
- angular - Angular 表单提交应被禁用,但单击时仍显示错误
- docker - 如何在 docker-compose .env 文件中包含特殊字符(例如'=')作为变量值的一部分?
- flask - 使用 Flask 和 axios 创建这个 Stripe 费用我做错了什么?
- c - while循环中的两个条件是什么?
- ruby - 使用 Rake 时使用 Reveal.js 作为 Asciidoctor 后端
- angular - 如何在Angular 6中绑定Web api数据以形成选择选项
- json - 使用可解码协议解析 JSON
- c# - 如何遍历比循环更大的列表?