{"id":20832304,"url":"https://github.com/andimiller/munit-cats-effect-styles","last_synced_at":"2026-05-23T11:04:36.276Z","repository":{"id":40441344,"uuid":"408982605","full_name":"andimiller/munit-cats-effect-styles","owner":"andimiller","description":"Some Suites for munit-cats-effect","archived":false,"fork":false,"pushed_at":"2023-05-20T22:59:03.000Z","size":19,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-18T20:59:10.340Z","etag":null,"topics":["cats","functional-programming","munit","scala","testing"],"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/andimiller.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}},"created_at":"2021-09-21T21:45:06.000Z","updated_at":"2023-10-28T17:08:29.000Z","dependencies_parsed_at":"2023-09-24T18:11:43.892Z","dependency_job_id":null,"html_url":"https://github.com/andimiller/munit-cats-effect-styles","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"d76e8e3104194deed93e92b86291295e96f5536a"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andimiller%2Fmunit-cats-effect-styles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andimiller%2Fmunit-cats-effect-styles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andimiller%2Fmunit-cats-effect-styles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andimiller%2Fmunit-cats-effect-styles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andimiller","download_url":"https://codeload.github.com/andimiller/munit-cats-effect-styles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243183077,"owners_count":20249733,"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":["cats","functional-programming","munit","scala","testing"],"created_at":"2024-11-18T00:11:11.531Z","updated_at":"2025-12-26T11:40:04.145Z","avatar_url":"https://github.com/andimiller.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# munit-cats-effect-styles\n\nThis is a library for adding ScalaTest style testing layouts for munit with cats-effect.\n\nThis may seem quite opinionated, and it is, this is just the way I like to test things, although I am open to expanding it.\n\nIt's cross published for Scala 2.12, 2.13 and 3, scala JVM and scala JS, and cats-effect 2 and 3.\n\n## Dependencies\n\nIt's published to maven central and only depends on `munit-cats-effect`.\n\n```scala\n// for cats-effect-2\nlibraryDependencies += \"net.andimiller\" %%% \"munit-cats-effect-2-styles\" % \"1.0.0\" % Test\ntestFrameworks += new TestFramework(\"munit.Framework\")\n// for cats-effect-3\nlibraryDependencies += \"net.andimiller\" %%% \"munit-cats-effect-3-styles\" % \"1.0.0\" % Test\ntestFrameworks += new TestFramework(\"munit.Framework\")\n```\n\nFor `scala-native` support, or the latest munit milestones, please use the non-versioned dependency, which is cats-effect-3 only:\n\n```scala\nlibraryDependencies += \"net.andimiller\" %%% \"munit-cats-effect-styles\" % \"2.0.0-M1\" % Test\ntestFrameworks += new TestFramework(\"munit.Framework\")\n```\n\n## Styles\n### FlatSpec\n\nSame as the ScalaTest style, this lets you write tests with the word `should` in the middle.\n\nSince we're assuming cats-effect, the body for your `in` should be either an `IO[Any]` or  a scalacheck `Prop`.\n\n```scala\nimport cats.effect.IO\nimport org.scalacheck.Prop.forAll\nimport net.andimiller.munit.cats.effect.styles.FlatIOSpec\n\nclass FlatIOSpecSpec extends FlatIOSpec {\n\n  \"a subject\" should \"do stuff\" in {\n    IO { 1234 }.assertEquals(1234)\n  }\n\n  \"another subject\" should \"meet a property\" in {\n    forAll { (s: String) =\u003e s.reverse.reverse == s }\n  }\n\n}\n```\n\n### WordSpec\n\nSame as the ScalaTest style, this lets you write nested tests using `should` and then `in`.\n\nSince we're assuming cats-effect, the body for your `in` should be either an `IO[Any]` or  a scalacheck `Prop`.\n\n```scala\nimport cats.effect.IO\nimport net.andimiller.munit.cats.effect.styles.WordIOSpec\nimport org.scalacheck.Prop.forAll\n\nclass WordIOSpecSpec extends WordIOSpec {\n\n  \"subject\" should {\n    \"test one\" in {\n      IO {\n        1234\n      }.assertEquals(1234)\n    }\n    \"test two\" in {\n      interceptIO[Throwable](\n        IO {\n          throw new Exception\n        }\n      )\n    }\n    \"some property\" in {\n      forAll { (s: String) =\u003e\n        s.reverse.reverse == s\n      }\n    }\n  }\n\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandimiller%2Fmunit-cats-effect-styles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandimiller%2Fmunit-cats-effect-styles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandimiller%2Fmunit-cats-effect-styles/lists"}