Skip to content

Commit 86efd8b

Browse files
committed
Add munit dependency and dummy test
At this point, munit is the standard everyone should start with.
1 parent 1e103be commit 86efd8b

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

.github/workflows/ci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ jobs:
3838
~/Library/Caches/Coursier/v1
3939
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
4040

41-
- name: Run project
41+
- name: Run the project
4242
run: sbt run
43+
44+
- name: Run the unit tests
45+
run: sbt test

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
## Usage
66

7-
This is a normal sbt project. You can compile code with `sbt compile` and run it
8-
with `sbt run`. `sbt console` will start a Scala 3 REPL.
7+
This is a normal sbt project. You can compile code with `sbt compile`, run the main
8+
method with `sbt run` and run the tests with `sbt test`. `sbt console` will start a Scala 3 REPL.
99

1010
If compiling this example project fails, you probably have a global sbt plugin
1111
that does not work with Scala 3. You might try disabling plugins in

build.sbt

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ lazy val root = project
44
name := "scala3-example-project",
55
description := "Example sbt project that compiles using Scala 3",
66
version := "0.1.0",
7-
scalaVersion := "3.1.1"
7+
scalaVersion := "3.1.1",
8+
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test
89
)

src/test/scala/MySuite.scala

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// For more information on writing tests, see
2+
// https://scalameta.org/munit/docs/getting-started.html
3+
class MySuite extends munit.FunSuite {
4+
test("example test that succeeds") {
5+
val obtained = 42
6+
val expected = 42
7+
assertEquals(obtained, expected)
8+
}
9+
}

0 commit comments

Comments
 (0)