{"id":15404198,"url":"https://github.com/exoego/scalajs-test-helper","last_synced_at":"2025-10-11T07:30:28.897Z","repository":{"id":39845579,"uuid":"236626059","full_name":"exoego/scalajs-test-helper","owner":"exoego","description":"Useful assertions for testing Scala.js","archived":true,"fork":false,"pushed_at":"2024-07-29T14:33:59.000Z","size":401,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-17T14:17:27.957Z","etag":null,"topics":["munit","scala-js","scalatest"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exoego.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-28T00:25:17.000Z","updated_at":"2024-07-30T00:50:07.000Z","dependencies_parsed_at":"2024-06-28T17:04:41.858Z","dependency_job_id":null,"html_url":"https://github.com/exoego/scalajs-test-helper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exoego%2Fscalajs-test-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exoego%2Fscalajs-test-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exoego%2Fscalajs-test-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exoego%2Fscalajs-test-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exoego","download_url":"https://codeload.github.com/exoego/scalajs-test-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236057511,"owners_count":19088062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["munit","scala-js","scalatest"],"created_at":"2024-10-01T16:11:52.987Z","updated_at":"2025-10-11T07:30:23.598Z","avatar_url":"https://github.com/exoego.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"Scala.js Test Helper\n----\n\nThis project provides custom assertions and other helpers, which are convenient for writing test in Scala.js.\n\n\n## Usage\n\n### With [ScalaTest](http://www.scalatest.org)\n\nThe `scalajs-test-helper-scalatest` library is available for Scala.js 0.6.x and 1.0.0.\n\n```scala\nlibraryDependencies += \"net.exoego\" %%% \"scalajs-test-helper-scalatest\" % \"0.2.0\" % Test\n```\n\nImport `net.exoego.scalajs.scalatest.structural._`.\nThis imports some [custom `Equality`](http://www.scalactic.org/user_guide/CustomEquality) implementations for JavaScript objects (e.g. `js.Object` and `js.Array`).\nThose allows comparing two JS objects based on its contents, as similar as comparing Scala objects.\n\n```scala\n\nimport org.scalatest.funsuite.AnyFunSuite\nimport scala.scalajs.js\n\nclass JsObjectStructuralEqualityTest extends AnyFunSuite {\n  import net.exoego.scalajs.scalatest.structural._\n\n  test(\"content equal of js.Array\") {\n    assert(js.Array() != js.Array())\n\n    assert(js.Array() === js.Array())\n    assert(js.Array(1, \"a\") === js.Array(1, \"a\"))\n    assert(js.Array(new js.Object()) === js.Array(new js.Object()))\n  }\n}\n```\n\n\n### With [MUnit](https://scalameta.org/munit/)\n\nThe `scalajs-test-helper-munit` library is available for Scala.js 0.6.x and 1.0.0.\n\n```scala\nlibraryDependencies += \"net.exoego\" %%% \"scalajs-test-helper-munit\" % \"0.2.0\" % Test\n```\n\nImport `net.exoego.scalajs.munit.ScalaJSAssertions` and extend it by your Test class.\nThose allows comparing two JS objects based on its contents, as similar as comparing Scala objects.\n\n```scala\n\nimport scala.scalajs.js\nimport net.exoego.scalajs.munit.ScalaJSAssertions\n\nclass JsObjectStructuralEqualityTest extends munit.FunSuite with ScalaJSAssertions {\n\n  test(\"content equal of js.Array\") {\n    assertStructuralEquals(js.Array(), js.Array())\n    assertStructuralEquals(js.Array(1, \"a\"), js.Array(1, \"a\"))\n    assertStructuralEquals(js.Array(new js.Object()), js.Array(new js.Object()))\n\n    assertNotStructuralEquals(js.Array(0, \"b\"), js.Array(1, \"a\"))\n  }\n}\n```\n\n### Other test library\n\nNot supported but welcome contributions.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexoego%2Fscalajs-test-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexoego%2Fscalajs-test-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexoego%2Fscalajs-test-helper/lists"}