How do I run a SBT unit test?
Setup
- On the command line, create a new directory somewhere.
- cd into the directory and run sbt new scala/scalatest-example.g8.
- Name the project ScalaTestTutorial .
- The project comes with ScalaTest as a dependency in the build. sbt file.
- cd into the directory and run sbt test .
How do I create a SBT file?
sbt builds
- Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Build Tools | sbt.
- In the sbt projects section, select a project for which you want to configure build actions.
- In the sbt shell section, select the builds option. Click OK to save the changes.
Does SBT run tests in parallel?
sbt maps each test class to a task. sbt runs tasks in parallel and within the same JVM by default.
How run SBT project from command line?
Running the project
- cd into hello-world .
- Run sbt . This will open up the sbt console.
- Type ~run . The ~ is optional and causes sbt to re-run on every file save, allowing for a fast edit/run/debug cycle. sbt will also generate a target directory which you can ignore.
Does sbt test compile?
The following commands will make sbt watch for source changes in the Test and Compile (default) configurations respectively and re-run the compile command. Note that because Test / compile depends on Compile / compile , source changes in the main source directory will trigger recompilation of the test sources.
Where is build sbt file?
Create or open your sbt project. In the Project tool window, in the source root directory, locate the build. properties file and open it in the editor. In the editor explicitly specify the version of sbt that you want to use in the project.
Does SBT test compile?
What is SBT console?
SBT is tied to a specific project defined by a build. sbt file in a way that $ sbt console will load up the same REPL environment as $ scala but with the addition of all of the project code and dependencies defined in the build available for import. Also, it will use the version of Scala defined by build. sbt .