Skip to main content

Library Integrations

MUnit

Add this to your SBT build

"com.github.jatcwang" %% "difflicious-munit" % "0.5.1" % Test

and then in your test suites you can call assertNoDiff on any Differ.

import munit.FunSuite
import difflicious.munit.MUnitDiff.*
import difflicious.Differ

class MyTest extends FunSuite {
test("a == b") {
Differ[Int].assertNoDiff(1, 2)
}
}

Scalatest

Add this to your SBT build

"com.github.jatcwang" %% "difflicious-scalatest" % "0.5.1" % Test

Tests should be run with the -oW option to disable Scalatest from coloring test failures all red as it interferes with difflicious color display.

testOnly -- -oW

Here's an example of what a test using difflicious looks like:

import org.scalatest.funsuite.AnyFunSuite
import difflicious.scalatest.ScalatestDiff.*
import difflicious.Differ

class MyTest extends AnyFunSuite {
test("a == b") {
Differ[Int].assertNoDiff(1, 2)
}
}

Weaver

Add this to your SBT build

"com.github.jatcwang" %% "difflicious-weaver" % "0.5.1" % Test

and then in your test suites you can call assertNoDiff on any Differ.

import weaver.SimpleIOSuite
import difflicious.weaver.WeaverDiff.*
import difflicious.Differ

object MyTest extends SimpleIOSuite {
pureTest("a == b") {
Differ[Int].assertNoDiff(1, 2)
}
}

Cats

Differ instances for cats data structures like NonEmptyList and Chain can be found in

"com.github.jatcwang" %% "difflicious-cats" % "0.5.1" % Test
import difflicious.Differ
import difflicious.cats.implicits.*
import cats.data.{NonEmptyMap, NonEmptyList}

val differ: Differ[List[NonEmptyMap[String, NonEmptyList[Int]]]] = Differ[List[NonEmptyMap[String, NonEmptyList[Int]]]]
// differ: Differ[List[NonEmptyMap[String, NonEmptyList[Int]]]] = difflicious.differ.SeqDiffer@57f286ad