Skip to content

Commit

Permalink
Merge pull request #3 from busymachines/prepare-release-0.2.0
Browse files Browse the repository at this point in the history
Prepare 0.2.0 release
  • Loading branch information
lorandszakacs authored Apr 2, 2021
2 parents 83378b8 + 1e92503 commit 450223a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
Expand All @@ -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 --------
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 450223a

Please sign in to comment.