Skip to content

Commit cbb052c

Browse files
committed
Upgrade deps and remove Scalaz
1 parent cfe02ff commit cbb052c

File tree

24 files changed

+72
-227
lines changed

24 files changed

+72
-227
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ This is a library that:
6262
* Comes with various `DomZipper` implementations and backends.
6363
* Lots of platform-specific utilities for web testing.
6464
* Configurable error handling. Be impure and throw exceptions or be pure and use a custom ADT to precisely maintain all forms of failure and error in your domain; it's up to you.
65-
* Extension modules for various 3rd-party libraries. (Scalaz, Cats, more.)
65+
* Extension modules for various 3rd-party libraries. (Cats, more.)
6666

6767

6868
# How does this work?
@@ -103,7 +103,6 @@ When retries are enabled, then test execution is
103103
| `ext-cats` | Extensions for [Cats](https://github.com/typelevel/cats). | JVM | JS |
104104
| `ext-nyaya` | Extensions for [Nyaya](https://github.com/japgolly/nyaya). | JVM | JS |
105105
| `ext-scalajs-react` | Extensions for [scalajs-react](https://github.com/japgolly/scalajs-react). | | JS |
106-
| `ext-scalaz` | Extensions for [Scalaz](https://github.com/scalaz/scalaz). | JVM | JS |
107106
| `ext-selenium` | Extensions for [Selenium](https://www.seleniumhq.org). | JVM | |
108107

109108

build.sbt

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ val extCatsJS = TestState.extCatsJS
2222
val extNyayaJVM = TestState.extNyayaJVM
2323
val extNyayaJS = TestState.extNyayaJS
2424
val extScalaJsReact = TestState.extScalaJsReact
25-
val extScalazJVM = TestState.extScalazJVM
26-
val extScalazJS = TestState.extScalazJS
2725
val extSelenium = TestState.extSelenium
2826

2927
val examples = TestState.examples

core/js/src/main/scala/teststate/typeclass/Platform.scala

+3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package teststate.typeclass
22

3+
import scala.annotation.nowarn
4+
35
private[typeclass] object Platform {
46

7+
@nowarn("cat=unused")
58
def threadSleep(timeMs: Long): Unit =
69
System.err.print("Thread.sleep() unavailable on JavaScript.")
710

core/shared/src/test/scala/teststate/ActionTest.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package teststate
22

3-
import scalaz.std.string._
4-
import scalaz.std.vector._
3+
import cats.instances.string._
4+
import cats.instances.vector._
55
import teststate.Exports._
66
import teststate.TestUtil._
77
import teststate.data.VectorTree

core/shared/src/test/scala/teststate/CompositionTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package teststate
22

3+
import cats.instances.string._
34
import nyaya.prop._
45
import nyaya.test.PropTest._
5-
import scalaz.std.string.stringInstance
66
import teststate.Exports._
77
import teststate.RandomData.*
88
import teststate.TestUtil._

core/shared/src/test/scala/teststate/TestUtils.scala

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package teststate
22

3+
import cats.Eq
34
import sourcecode.Line
45
import teststate.Exports._
56

@@ -8,8 +9,8 @@ object TestUtil extends TestUtil
89
trait TestUtil
910
extends japgolly.microlibs.testutil.TestUtil {
1011

11-
implicit def testStateEqualityToScalaz[A](implicit e: Equal[A]): scalaz.Equal[A] =
12-
scalaz.Equal.equal(e.equal)
12+
implicit def testStateEqualityToCats[A](implicit e: Equal[A]): Eq[A] =
13+
Eq.instance(e.equal)
1314

1415
val inspectionBaseSettings =
1516
Report.Format.Default
@@ -32,7 +33,7 @@ trait TestUtil
3233
if (expectDefined)
3334
assertEq(name, o.isDefined, true)
3435
else
35-
assertEq(name, o, None)(scalaz.Equal.equalA, l)
36+
assertEq(name, o, None)(Eq.fromUniversalEquals, l)
3637

3738
val trim = (_: String).trim
3839
val stringIdFn = (s: String) => s

core/shared/src/test/scala/teststate/dsl/OptionAssertionsTest.scala

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package teststate.dsl
22

3+
import cats.instances.option._
4+
import cats.instances.string._
35
import japgolly.microlibs.testutil.TestUtil._
4-
import scalaz.std.anyVal._
5-
import scalaz.std.option._
6-
import scalaz.std.string._
76
import teststate.Exports._
87
import teststate.dsl.OptionAssertions._
98
import utest._

doc/TYPES.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ Plan(action, invariants) // Plan [Id, Ref, Obs, Int, S
6666
| Type | Desc |
6767
|------|------|
6868
| `Display[A]` | Typeclass used by `Dsl` assertions to turn expectation and actual values into `String`s for display. (For humans, unlike common `Show[A]`.) |
69-
| `Equal[A]` | Typeclass used by `Dsl` assertions for equality checking. Implicit conversions exist from: <ul><li>`japgolly.univeq.UnivEq[A]`.</li><li>`cats.Eq[A]` if using the Cats module.</li><li>`scalaz.Equal` if using the Scalaz module.</li></ul> |
69+
| `Equal[A]` | Typeclass used by `Dsl` assertions for equality checking. Implicit conversions exist from: <ul><li>`japgolly.univeq.UnivEq[A]`.</li><li>`cats.Eq[A]` if using the Cats module.</li></ul> |
7070
| `ExecutionModel[F[_]]` | Typeclass required to run tests in custom contexts. |
7171
| `Observer[-R, +O, +E]` | Creates observations. As indicate by type variance, ref comes in, observation or error come out. |
72-
| `Or[+A,+B]` | Disjunction. Internal replacement for stdlib's atrocious `Either`. Implicit conversions exist from: <ul><li>`scala.util.Either[A, B]`.</li><li>`cats.data.Xor[A,B]` if using the Cats module.</li><li>`scalaz.\/[A,B]` if using the Scalaz module.</li></ul> |
72+
| `Or[+A,+B]` | Disjunction. Internal replacement for stdlib's atrocious `Either`. Implicit conversions exist from: <ul><li>`scala.util.Either[A, B]`.</li><li>`cats.data.Xor[A,B]` if using the Cats module.</li></ul> |
7373
| `Attempt[+E]` | Turns a `Throwable` into an `E`. |
7474
| `Report.AssertionSettings` | Typeclass that specifies how to display pass/fail results on a `Report`. |

doc/USAGE.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,20 @@
1919
"com.github.japgolly.test-state" %%% "ext-cats" % TestStateVer % "test",
2020
"com.github.japgolly.test-state" %%% "ext-nyaya" % TestStateVer % "test",
2121
"com.github.japgolly.test-state" %%% "ext-scalajs-react" % TestStateVer % "test",
22-
"com.github.japgolly.test-state" %%% "ext-scalaz" % TestStateVer % "test")
22+
)
2323
```
2424

2525
<br>Please note that if your sbt is setup to use [scalajs-bundler](https://scalacenter.github.io/scalajs-bundler/), *currently* you still need to enable the older JsDependenciesPlugin for the js dependencies from above to be included in your final js file. For example:
26+
2627
```scala
2728
lazy val client = (project in file("client"))
2829
.enablePlugins(ScalaJSPlugin)
2930
.enablePlugins(ScalaJSBundlerPlugin)
3031
.enablePlugins(JSDependenciesPlugin) This is needed even if you are managing your other js depndencies using scalajs-bundler
31-
32-
npmDependencies in Compile ++= Seq( "react" -> "16.13.1", "react-dom" -> "16.13.1") scalajs-bundler style external js dependencies
33-
....
34-
```
35-
36-
37-
3832

33+
npmDependencies in Compile ++= Seq( "react" -> "16.13.1", "react-dom" -> "16.13.1") scalajs-bundler style external js dependencies
34+
....
35+
```
3936

4037
1. Create a configuration for your needs.
4138
<br>Each module has a `trait` containing all of its public API.
@@ -52,7 +49,6 @@
5249
with teststate.ExtCats
5350
with teststate.ExtNyaya
5451
with teststate.ExtScalaJsReact
55-
with teststate.ExtScalaz
5652
{
5753
// Additional config here if desired.
5854

@@ -73,7 +69,7 @@
7369

7470
1. On your `Test`, call `.run` to execute it.
7571
<br>*(Technically execution depends on the context as described in [TYPES.md](TYPES.md).
76-
E.g. if the context is a `scalaz.effect.IO` then nothing will have been executed yet and you're free to call `.unsafePerformIO` yourself.)*
72+
E.g. if the context is a `cats.effect.IO` then nothing will have been executed yet and you're free to call `.unsafePerformIO` yourself.)*
7773

7874
1. The result will be a `Report[E]` where `E` (the error type) is by default a `String`.
7975
You're free to inspect the results if desired but...

doc/changelog/2.5.0.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22

33
* Drop support for Scala.JS 0.6.x
44
* Drop support for Scala 2.12
5-
6-
* Upgrade dependencies:
7-
* Scala.JS 1.6.0
8-
* scalajs-react 1.7.5
9-
* scalajs-dom 1.1.0
5+
* Drop support for Scalaz
6+
* Upgrade all dependencies

dom-zipper-jsoup/src/test/scala/teststate/domzipper/jsoup/DomZipperJsoupTest.scala

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package teststate.domzipper.jsoup
22

3+
import cats.instances.option._
4+
import cats.instances.set._
5+
import cats.instances.string._
6+
import cats.instances.vector._
37
import japgolly.microlibs.testutil.TestUtil._
48
import org.jsoup.Jsoup
5-
import scalaz.std.anyVal._
6-
import scalaz.std.option._
7-
import scalaz.std.set._
8-
import scalaz.std.string._
9-
import scalaz.std.vector._
109
import teststate.domzipper.jsoup.Exports._
1110
import utest._
1211

dom-zipper-selenium/src/test/scala/teststate/domzipper/selenium/DomZipperSeleniumTest.scala

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package teststate.domzipper.selenium
22

3+
import cats.instances.option._
4+
import cats.instances.set._
5+
import cats.instances.string._
6+
import cats.instances.vector._
37
import japgolly.microlibs.testutil.TestUtil._
48
import java.util.concurrent.TimeUnit
59
import org.openqa.selenium.chrome.{ChromeDriver, ChromeOptions}
6-
import scalaz.std.anyVal._
7-
import scalaz.std.option._
8-
import scalaz.std.set._
9-
import scalaz.std.string._
10-
import scalaz.std.vector._
1110
import teststate.domzipper.selenium.Exports._
1211
import utest._
1312

dom-zipper-selenium/src/test/scala/teststate/domzipper/selenium/FastDomZipperSeleniumTest.scala

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package teststate.domzipper.selenium
22

3+
import cats.instances.option._
4+
import cats.instances.set._
5+
import cats.instances.string._
6+
import cats.instances.vector._
37
import japgolly.microlibs.testutil.TestUtil._
48
import java.util.concurrent.TimeUnit
59
import org.openqa.selenium.chrome.{ChromeDriver, ChromeOptions}
6-
import scalaz.std.anyVal._
7-
import scalaz.std.option._
8-
import scalaz.std.set._
9-
import scalaz.std.string._
10-
import scalaz.std.vector._
1110
import teststate.domzipper.selenium.Exports._
1211
import utest._
1312

dom-zipper-sizzle/src/test/scala/teststate/domzipper/DomZipperJsTest.scala

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
package teststate.domzipper
22

3+
import cats.instances.option._
4+
import cats.instances.set._
5+
import cats.instances.string._
6+
import cats.instances.vector._
37
import japgolly.microlibs.testutil.TestUtil.assertEq
48
import org.scalajs.dom
5-
import scalaz.Equal
6-
import scalaz.std.anyVal._
7-
import scalaz.std.option._
8-
import scalaz.std.set._
9-
import scalaz.std.string._
10-
import scalaz.std.vector._
119
import teststate.domzipper.sizzle.Exports._
1210
import utest._
1311

1412
object DomZipperJsTest extends TestSuite {
15-
Equal.equalA
1613

1714
private def body =
1815
"""

dom-zipper/shared/src/main/scala/teststate/domzipper/ErrorHandler.scala

-8
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,4 @@ object ErrorHandler {
7575
override def map[A, B](r: Option[A])(f: A => B) = r map f
7676
override def flatMap[A, B](r: Option[A])(f: A => Option[B]) = r flatMap f
7777
}
78-
79-
// object ReturnDisjunction extends ErrorHandler {
80-
// import scalaz._
81-
// override type Result[A] = String \/ A
82-
// override def pass[A](a: A) = \/-(a)
83-
// override def fail[A](e: => String) = -\/(e)
84-
// override def map[A, B](r: Result[A])(f: A => B) = r map f
85-
// }
8678
}

ext-scalaz/shared/src/main/scala/teststate/ExtScalaz.scala

-74
This file was deleted.

ext-scalaz/shared/src/test/scala/teststate/external/ExtScalazTest.scala

-44
This file was deleted.

ext-selenium/src/test/scala/teststate/selenium/GrowthStrategyTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package teststate.selenium
22

3+
import cats.instances.string._
34
import japgolly.microlibs.testutil.TestUtil._
4-
import scalaz.std.string._
55
import utest._
66

77
object GrowthStrategyTest extends TestSuite {

0 commit comments

Comments
 (0)