diff --git a/CHANGELOG.md b/CHANGELOG.md index 91f74e0..f487fdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # unreleased +# 0.2.0 + ### :warning: Breaking changes :warning: - replace scalatest w/ [munit](https://github.com/scalameta/munit/releases) `0.7.23`. Do not forget to add `testFrameworks += new TestFramework("munit.Framework")` to your build, as per [usage instructions](https://scalameta.org/munit/docs/getting-started.html) diff --git a/README.md b/README.md index 5294bd0..591c718 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ See [changelog](./CHANGELOG.md). ## modules -- `"com.busymachines" %% s"pureharm-testkit" % "0.1.0"`. Which has these as its main dependencies: +- `"com.busymachines" %% s"pureharm-testkit" % "0.2.0"`. Which has these as its main dependencies: - [munit](https://github.com/scalameta/munit/releases) `0.7.23` - [log4cats-core](https://github.com/typelevel/log4cats/releases) `1.2.2` - [pureharm-core-anomaly](https://github.com/busymachines/pureharm-core/releases) `0.2.0` @@ -19,7 +19,13 @@ See [changelog](./CHANGELOG.md). ## usage -Create your own "testkit" package. And use that everywhere. +Follow the [munit](https://scalameta.org/munit/docs/getting-started.html) setup to add the appropriate test framework to your build. + +```scala +testFrameworks += new TestFramework("munit.Framework") +``` + +Then, create your own "testkit" package. And use that everywhere. ```scala package myapp @@ -32,6 +38,10 @@ package object test extends testkit.PureharmTestkitAliases package myapp.test +/** + * Add any custom assertions, flavors, styles, opiniated decisions + * here, and continue using this. + */ abstract class MyAppTest extends testkit.PureharmTestkit //-------- EOF -------- @@ -41,16 +51,16 @@ package myapp.somemodule import myapp.test._ final class MyTest extends MyAppTest { + test("no resource")(IO.unit) + private val myResource = ResourceFixture((to: TestOptions) => Resource.eval(testLogger.info(s"Making: $to") >> Timer[IO].sleep(10.millis))) myResource.test(TestOptions("with resource").tag(Slow))((_: Unit) => testLogger.info("Executing test w/ resource")) - - test("no resource")(IO.unit) } ``` -Under construction. See [release notes](https://github.com/busymachines/pureharm-core/releases) and tests for examples. +Still under construction. See [release notes](https://github.com/busymachines/pureharm-testkit/releases) and tests for examples. ## Copyright and License diff --git a/testkit/shared/src/main/scala/busymachines/pureharm/testkit/types.scala b/testkit/shared/src/main/scala/busymachines/pureharm/testkit/types.scala index 6ad21cf..e7ec408 100644 --- a/testkit/shared/src/main/scala/busymachines/pureharm/testkit/types.scala +++ b/testkit/shared/src/main/scala/busymachines/pureharm/testkit/types.scala @@ -31,7 +31,7 @@ object types { | - busymachines.pureharm.testkit.PureharmTest | |The purpose of TestLogger is to log everything related to test-setup/ - |tear-down to enrich whatever scalatest tells you + |tear-down to enrich whatever munit tells you |""" ) type TestLogger = TestLogger.Type