Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Baccata committed May 12, 2024
1 parent 0cba540 commit 79c6684
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@ lazy val examples = crossProject(JVMPlatform, JSPlatform)
"software.amazon.smithy" % "smithy-model" % smithyVersion
)
)
.jsSettings(
Test / fork := false
)
7 changes: 5 additions & 2 deletions modules/tests/jvm/src/test/scala/utils.test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ trait SchemaSuite extends FunSuite {
def checkSchema[A: Schema](modelStrings: String*)(using Location) = {
val unvalidated = DynamicSchemaIndex.builder.addAll(Schema[A]).build().toSmithyModel
val node = ModelSerializer.builder().build().serialize(unvalidated)
val validated = Model.assembler().addDocumentNode(node).assemble().unwrap()
val validated = Model.assembler().discoverModels().addDocumentNode(node).assemble().unwrap()
val filtered = ModelTransformer
.create()
.filterShapes(validated, _.getId().getNamespace() != "smithy4s.deriving.internals")
val expectedAssembler = Model.assembler()
modelStrings.zipWithIndex.foreach { case (string, index) =>
expectedAssembler.addUnparsedModel(s"expected$index.smithy", string)
}
val expected = expectedAssembler.assemble().unwrap()
assertEquals(ModelWrapper(validated), ModelWrapper(expected))
assertEquals(ModelWrapper(filtered), ModelWrapper(expected))
}
}

Expand Down

0 comments on commit 79c6684

Please sign in to comment.