{"id":13800327,"url":"https://github.com/monix/minitest","last_synced_at":"2026-04-02T18:45:31.922Z","repository":{"id":24654194,"uuid":"28064293","full_name":"monix/minitest","owner":"monix","description":"The super light testing library for Scala and Scala.js","archived":false,"fork":false,"pushed_at":"2024-08-12T23:45:08.000Z","size":804,"stargazers_count":180,"open_issues_count":12,"forks_count":31,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-02T06:12:28.811Z","etag":null,"topics":["laws","scala","scalacheck","testing"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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":"2014-12-16T01:17:08.000Z","updated_at":"2025-10-10T08:13:19.000Z","dependencies_parsed_at":"2024-06-19T02:52:19.879Z","dependency_job_id":"940cad5c-3342-4342-ac61-4e0bc100b906","html_url":"https://github.com/monix/minitest","commit_stats":null,"previous_names":["monifu/minitest"],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/monix/minitest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monix%2Fminitest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monix%2Fminitest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monix%2Fminitest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monix%2Fminitest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monix","download_url":"https://codeload.github.com/monix/minitest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monix%2Fminitest/sbom","scorecard":{"id":658559,"data":{"date":"2025-08-11","repo":{"name":"github.com/monix/minitest","commit":"fb23874c030fea4f8d6b160fd4df45bde71ca02b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":8,"reason":"Found 11/13 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/monix/minitest/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/monix/minitest/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/monix/minitest/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/scala.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/monix/minitest/scala.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/scala.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/monix/minitest/scala.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/scala.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/monix/minitest/scala.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/scala.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/monix/minitest/scala.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/scala.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/monix/.github/SECURITY.md:1","Info: Found linked content: github.com/monix/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/monix/.github/SECURITY.md:1","Info: Found text in security policy: github.com/monix/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T15:23:53.453Z","repository_id":24654194,"created_at":"2025-08-21T15:23:53.453Z","updated_at":"2025-08-21T15:23:53.453Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["laws","scala","scalacheck","testing"],"created_at":"2024-08-04T00:01:11.478Z","updated_at":"2026-04-02T18:45:31.906Z","avatar_url":"https://github.com/monix.png","language":"Scala","readme":"# Minitest\n\nA mini testing framework cross-compiled for Scala 2.12, 2.13, 3.0, and [Scala.JS 1.x](http://www.scala-js.org/).\n\n![build](https://github.com/monix/minitest/workflows/build/badge.svg)\n\n## Usage in SBT\n\nFor `build.sbt` (use the `%%%` operator for Scala.js):\n\n```scala\n// use the %%% operator for Scala.js\nlibraryDependencies += \"io.monix\" %% \"minitest\" % \"2.9.6\" % \"test\"\n\ntestFrameworks += new TestFramework(\"minitest.runner.Framework\")\n```\n\nIn case you want the optional package for integration with the latest\n[ScalaCheck](https://www.scalacheck.org/), at the moment of writing\nthis being version `1.15.4`:\n\n```scala\n// use the %%% operator for Scala.js\nlibraryDependencies += \"io.monix\" %% \"minitest-laws\" % \"2.9.6\" % \"test\"\n```\n\nGiven that updates for ScalaCheck have been problematic, the ecosystem\nbeing at the moment of writing using an older version, a \"legacy\" package\nis currently provided for usage with ScalaCheck `1.13.5`:\n\n```scala\n// use the %%% operator for Scala.js\nlibraryDependencies += \"io.monix\" %% \"minitest-laws-legacy\" % \"2.7.0\" % \"test\"\n```\n\nNote that at this time the laws package is not available for Scala\nNative, due to ScalaCheck not being available for it.\n\n## Tutorial\n\nTest suites MUST BE objects, not classes. To create a simple test suite, it could\ninherit from [SimpleTestSuite](shared/src/main/scala/minitest/SimpleTestSuite.scala):\n\nHere's a simple test:\n\n```scala\nimport minitest._\n\nobject MySimpleSuite extends SimpleTestSuite {\n  test(\"should be\") {\n    assertEquals(2, 1 + 1)\n  }\n\n  test(\"should not be\") {\n    assert(1 + 1 != 3)\n  }\n\n  test(\"should throw\") {\n    class DummyException extends RuntimeException(\"DUMMY\")\n    def test(): String = throw new DummyException\n\n    intercept[DummyException] {\n      test()\n    }\n    ()\n  }\n\n  test(\"test result of\") {\n    assertResult(\"hello world\") {\n      \"hello\" + \" \" + \"world\"\n    }\n  }\n}\n```\n\nIn case you want to setup an environment for each test and need `setup` and\n`tearDown` semantics, per test, you could inherit from\n[TestSuite](shared/src/main/scala/minitest/TestSuite.scala). Then on each `test` definition,\nyou'll receive a fresh value:\n\n```scala\nimport minitest.TestSuite\n\nobject MyTestSuite extends TestSuite[Int] {\n  def setup(): Int = {\n    Random.nextInt(100) + 1\n  }\n\n  def tearDown(env: Int): Unit = {\n    assert(env \u003e 0, \"should still be positive\")\n  }\n\n  test(\"should be positive\") { env =\u003e\n    assert(env \u003e 0, \"positive test\")\n  }\n\n  test(\"should be lower or equal to 100\") { env =\u003e\n    assert(env \u003c= 100, s\"$env \u003e 100\")\n  }\n}\n```\n\nSome tests require setup and tear down logic to happen only once per test suite\nbeing executed and `TestSuite` supports that as well, but note you should abstain\nfrom doing this unless you really need it, since the per test semantics are much\nsaner:\n\n```scala\nobject MyTestSuite extends TestSuite[Int] {\n  private var system: ActorSystem = _\n\n  override def setupSuite(): Unit = {\n    system = ActorSystem.create()\n  }\n\n  override def tearDownSuite(): Unit = {\n    TestKit.shutdownActorSystem(system)\n    system = null\n  }\n}\n```\n\nMinitest supports asynchronous results in tests, just use `testAsync` and\nreturn a `Future[Unit]`:\n\n```scala\nimport scala.concurrent.ExecutionContext.Implicits.global\n\nobject MySimpleSuite extends SimpleTestSuite {\n  testAsync(\"asynchronous execution\") {\n    val future = Future(100).map(_+1)\n\n    for (result \u003c- future) yield {\n      assertEquals(result, 101)\n    }\n  }\n}\n```\n\nMinitest has integration with [ScalaCheck](https://www.scalacheck.org/).\nSo for property-based testing:\n\n```scala\nimport minitest.laws.Checkers\n\nobject MyLawsTest extends SimpleTestSuite with Checkers {\n  test(\"addition of integers is commutative\") {\n    check2((x: Int, y: Int) =\u003e x + y == y + x)\n  }\n\n  test(\"addition of integers is associative\") {\n    check3((x: Int, y: Int, z: Int) =\u003e (x + y) + z == x + (y + z))\n  }\n}\n```\n\nAll available assertions are described in [minitest.api.Asserts](./shared/src/main/scala/minitest/api/Asserts.scala):\n\n```scala\n// Simple boolean testing\nassert(value == expected)\n\n// ... and with a message\nassert(value == expected, s\"value: $value == expected $expected\")\n\n// Equality testing\nassertEquals(value, expected)\n\n// Tests the result of an entire block of code\nassertResult(\"Hello, World!\") {\n  Seq(\"Hello\", \"World\").mkString(\", \") + \"!\"\n}\n\n// ... and with a hint\nassertResult(\"Hello, World!\", \"No hello?!?\") {\n  Seq(\"Hello\", \"World\").mkString(\", \") + \"!\"\n}\n\n// Tests that code throws some specific exception\nintercept[IllegalStateException] {\n  // ...\n  throw new IllegalStateException(\"boom!\")\n}\n\n// Tests that a specific piece of code does not compile\nassertDoesNotCompile(\"1.noSuchMethod\")\n\n// Tests that compilation fails for a piece of code with\n// a specific error message (via regular expression)\nassertDoesNotCompile(\"1.noSuchMethod\", \".*?noSuchMethod is not a member of Int\")\n\n// Ignores a piece of test, could be conditional\nif (isEnvironmentJavaScript) {\n  ignore(\"Test not available on top of JavaScript\")\n}\n\n// Cancels a test — same as ignoring, but slightly different meaning;\n// same result though\nif (isEnvironmentJavaScript) {\n  cancel(\"Test cannot proceed on top of JavaScript\")\n}\n\n// Fails a test immediately\nfail(\"Boom!\")\n```\n\nThat's all you need to know.\n\n## License\n\nAll code in this repository is licensed under the Apache License, Version 2.0.\nSee [LICENCE](./LICENSE).\n\nCopyright \u0026copy; 2014-2018 by The Minitest Project Developers.\n","funding_links":[],"categories":["Table of Contents","Testing","Unit Tests"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonix%2Fminitest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonix%2Fminitest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonix%2Fminitest/lists"}