Releases: typelevel/weaver-test
v0.9.3
What's Changed
The expect
macro respects user-provided source locations
You can now specify an implicit source location for helper functions that call expect
and expect.all
. The source location will be displayed in the failure message. For example:
def myHelper(x: Int, y: Int)(implicit loc: SourceLocation): Expectations = {
expect(x > y)
}
myHelper(1, 2) // The failure message points to this line in the source code
Improvements
- Propagate source locations in expect macro by @zainab-ali in #175
Updates
- Update cats-effect, cats-effect-testkit to 3.6.2 by @typelevel-steward[bot] in #170
- Update cats-effect, cats-effect-testkit to 3.6.3 by @typelevel-steward[bot] in #176
Behind the scenes
- Update sbt-scalafmt to 2.5.5 by @typelevel-steward[bot] in #165
- Update sbt, scripted-plugin to 1.11.3 by @typelevel-steward[bot] in #168
- Update sbt-mdoc to 2.7.2 by @typelevel-steward[bot] in #173
- Add guide on asserting equality. by @zainab-ali in #172
Full Changelog: v0.9.2...v0.9.3
v0.9.2
What's Changed
expect
failure message improved
The expect
and expect.all
failure messages now contain the source code of the failing assertion.
Improvements
- Scalafix rules for adding clues and using
expect.same
by @zainab-ali in #164 - Improve failure message of
expect.all
by @zainab-ali in #166 - Add source code to error message of expect. by @zainab-ali in #167
Full Changelog: v0.9.1...v0.9.2
v0.9.1
What's Changed
expect
failure message improved
The assertion failed
message now directs developers towards the clue
function.
Improvements
- Direct users towards clue function. by @zainab-ali in #160
Updates
- Update scala3-library, ... to 3.3.6 by @typelevel-steward in #148
- Update scala-library, scala-reflect to 2.13.16 by @zainab-ali in #159
- Update scala-library, scala-reflect to 2.12.20 by @typelevel-steward in #61
- Update sbt-scalajs, scalajs-compiler, ... to 1.18.2 by @typelevel-steward in #129
- Update scalacheck to 1.17.1 by @typelevel-steward in #32
- Update cats-effect, cats-effect-testkit to 3.5.7 by @typelevel-steward in #116
- Update cats-effect, cats-effect-testkit to 3.6.1 by @typelevel-steward in #162
- Update fs2-core to 3.12.0 by @typelevel-steward in #145
Behind the scenes
- Set tlBaseVersion to 0.9. by @zainab-ali in #152
- Update sbt-typelevel, sbt-typelevel-site to 0.7.7 by @typelevel-steward in #131
- Update sbt, scripted-plugin to 1.11.2 by @typelevel-steward in #158
- Update sbt-typelevel, sbt-typelevel-site to 0.8.0 by @typelevel-steward in #157
- Update sbt-scalafix to 0.14.3 by @typelevel-steward in #149
- Update scalafmt-core to 3.9.6 by @typelevel-steward in #147
- Update sbt-scalafmt to 2.5.4 by @typelevel-steward in #125
- Update sbt-mdoc to 2.5.4 by @typelevel-steward in #56
- Update portable-scala-reflect to 1.1.3 by @typelevel-steward in #49
- Update cats-laws to 2.11.0 by @typelevel-steward in #47
- Update sbt-mdoc to 2.7.1 by @typelevel-steward in #161
- Fixup some things in the documentation that are not true anymore by @CJSmith-0141 in #154
- Add an FAQ about the stewardship change by @zainab-ali in #153
Full Changelog: v0.9.0...v0.9.1
v0.9.0
Migrating to weaver 0.9.0
The stewardship of Weaver has moved from disneystreaming
to typelevel
.
If you use Scala Steward, you will migrate automatically.
If you manage your dependency upgrades manually, you must:
- Rename any usages of
assert
toexpect
. If you use scalafix, you can apply a scalafix rule. For example, with SBT:sbt scalafixAll github:typelevel/weaver-test/RenameAssertToExpect?sha=v0.9.0
- Rename your weaver dependency:
- libraryDependencies += "com.disneystreaming" %% "weaver-cats" % "x.y.z" % Test
+ libraryDependencies += "org.typelevel" %% "weaver-cats" % "0.9.0" % Test
Rename any usages of CheckConfig.copy
to corresponding with*
methods:
override def checkConfig: CheckConfig =
- super.checkConfig.copy(minimumSuccessful = 1000)
+ super.checkConfig.withMinimumSuccessful(1000)
Note that if you use Scala Native, you may see linking errors due to weaver's shaded munit-diff
dependency. You can address these by explicitly adding munit-diff
:
libraryDependencies += "org.scalameta" %%% "munit-diff" % munitVersion % Test
What's Changed
assert
alias removed
The assert
macro has been removed in favour of a better expect
. You can rename assert
to expect
using scalafix, as described above.
clue
support
The expect
function now requires clues to print useful error messages. You can read more about clue
in the expectations documentation. If you'd prefer to skip the extra troubleshooting step of adding clue
to failing expectations, you can add clue
to all your existing expectations using scalafix.
sbt scalafixAll github:typelevel/weaver-test/AddClueToExpect?sha=v0.9.2
The expect.same
and expect.eql
functions don't use clues. If you wish, you can replace expectations of the form expect(a == b)
with expect.same(a, b)
using scalafix. Do this before adding clues to the expectations.
sbt scalafixAll github:typelevel/weaver-test/RenameExpectToExpectSame?sha=v0.9.2
If you wish to ensure that clue
is always used, you can configure scalafix to run it:
// In .scalafix.conf
rules = [
"github:typelevel/weaver-test/AddClueToExpect?sha=v0.9.2"
]
sbt scalafixAll --check
will fail if clue
is missing.
Better error messages
Weaver's error messages have been greatly improved thanks to munit-diff
.
Improvements
- Print stacktrace in logs by @henryxparker in #18
- Add Comparison trait. by @zainab-ali in #24
- Use munit diff logic by @zainab-ali in #25
- Use initial Seed in CheckConfig and failure message. by @zainab-ali in #39
- Use a LinkedBlockingQueue instead of polling. by @zainab-ali in #44
- Replace expecty with clue by @zainab-ali in #64
- Remove assert. by @zainab-ali in #69
Updates
- Update fs2-core to 3.10.2 by @typelevel-steward in #26
- Update sbt-scalajs, scalajs-compiler, ... to 1.16.0 by @typelevel-steward in #27
- Update scala-library, scala-reflect to 2.12.19 by @typelevel-steward in #28
- Update nscplugin, sbt-scala-native, ... to 0.4.17 by @typelevel-steward in #30
- Update sbt to 1.9.9 by @typelevel-steward in #31
- Update scalafmt-core to 3.7.17 by @typelevel-steward in #33
- Update cats-effect, cats-effect-testkit to 3.5.4 by @typelevel-steward in #34
- Update sbt-typelevel, sbt-typelevel-site to 0.7.0 by @typelevel-steward in #36
- Update sbt-scalafix to 0.12.1 by @typelevel-steward in #40
- Update sbt-shading to 2.1.5 by @typelevel-steward in #46
Behind the scenes
- Add initial Code of Conduct by @valencik in #4
- Remove the intellij runner, docs, and site link by @valencik in #2
- tests(catsJVM): fix paths in Cats JVM tests by @zetashift in #9
- Fix CI pipeline by @zainab-ali in #13
- Migrate build to sbt-typelevel by @valencik in #8
- Fix organization and artifact names by @armanbilge in #16
- Adds
.only
and.ignore
documentation. by @CJSmith-0141 in #12 - Migrate documentation to Laika (sbt-typelevel-site) by @CJSmith-0141 in #17
- Documentation cleanup by @CJSmith-0141 in #20
- Remove CODE_OF_CONDUCT override, use org default by @valencik in #21
- Add scalafix rule for renaming
assert
toexpect
by @zainab-ali in #70 - Update munit-diff to 1.0.0 by @typelevel-steward in #45
- Remove references to Disney. by @zainab-ali in #72
- Checkout
lfs
assets in the pages build. by @zainab-ali in #78 - Fail property test when discard count exceeds
maximumDiscarded
by @zainab-ali in #112 - Publish to s01 sonatype host. by @zainab-ali in #113
- Modify license to Apache. by @zainab-ali in #150
New Contributors
- @valencik made their first contribution in #4
- @zetashift made their first contribution in #9
- @zainab-ali made their first contribution in #13
- @armanbilge made their first contribution in #16
- @CJSmith-0141 made their first contribution in #12
- @henryxparker made their first contribution in #18
- @kubukoz made their first contribution in #11
- @typelevel-steward made their first contribution in #26
Full Changelog: https://github.com/typelevel/weaver-test/commits/v0.9.0