Skip to content

Commit

Permalink
make more tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdemarGr committed Jan 11, 2024
1 parent dbc00d8 commit 9e36cba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ lazy val sharedSettings = Seq(
"org.typelevel" %% "cats-parse" % "0.3.8",
"io.circe" %% "circe-core" % "0.14.6",
"io.circe" %% "circe-parser" % "0.14.6",
"io.circe" %% "circe-literal" % "0.14.6",
"org.tpolecat" %% "sourcepos" % "1.1.0",
"org.typelevel" %% "paiges-core" % "0.4.2",
"org.scalameta" %% "munit" % "1.0.0-M10" % Test,
Expand Down
9 changes: 7 additions & 2 deletions modules/server/src/test/scala/gql/StarWarsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ class StarWarsTest extends CatsEffectSuite {

def assertJsonIO(actual: IO[JsonObject])(expected: Json)(implicit loc: Location): IO[Unit] =
actual.map { jo =>
import io.circe.syntax._
assertEquals(jo.asJson, expected)
val eo = expected.asObject.get
val eoData = eo("data")
val eoErrors = eo("errors").flatMap(_.asArray).map(_.toSet)
val joData = jo("data")
val joErrors = jo("errors").flatMap(_.asArray).map(_.toSet)
assertEquals(joData, eoData)
assertEquals(joErrors, eoErrors)
}

test("the schema should be valid") {
Expand Down

0 comments on commit 9e36cba

Please sign in to comment.