{"id":13551218,"url":"https://github.com/invertase/spec","last_synced_at":"2025-04-05T12:09:04.750Z","repository":{"id":38246520,"uuid":"376859598","full_name":"invertase/spec","owner":"invertase","description":"✅ A streamlined testing framework for Dart \u0026 Flutter.","archived":false,"fork":false,"pushed_at":"2024-03-10T13:53:36.000Z","size":2451,"stargazers_count":302,"open_issues_count":11,"forks_count":18,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-29T11:11:27.391Z","etag":null,"topics":["cli","dart","flutter","hacktoberfest","testing"],"latest_commit_sha":null,"homepage":"https://docs.page/invertase/spec","language":"Dart","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/invertase.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2021-06-14T14:50:29.000Z","updated_at":"2024-10-19T09:46:30.000Z","dependencies_parsed_at":"2024-01-16T18:59:39.000Z","dependency_job_id":"89158877-4689-45de-8b2f-c26f29c984c7","html_url":"https://github.com/invertase/spec","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invertase%2Fspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invertase%2Fspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invertase%2Fspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invertase%2Fspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invertase","download_url":"https://codeload.github.com/invertase/spec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332612,"owners_count":20921853,"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":["cli","dart","flutter","hacktoberfest","testing"],"created_at":"2024-08-01T12:01:44.321Z","updated_at":"2025-04-05T12:09:04.723Z","avatar_url":"https://github.com/invertase.png","language":"Dart","readme":"\u003cp align=\"center\"\u003e\n  \u003ch1\u003e✅ Spec\u003c/h1\u003e\n  \u003cspan\u003eA streamlined testing framework for Dart \u0026 Flutter.\u003c/span\u003e\n\u003c/p\u003e\n\n\u003ca href=\"https://github.com/invertase/melos\"\u003e\u003cimg src=\"https://img.shields.io/badge/maintained%20with-melos-f700ff.svg?style=flat-square\" alt=\"Melos\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://docs.page\"\u003e\u003cimg src=\"https://img.shields.io/badge/powered%20by-docs.page-34C4AC.svg?style=flat-square\" alt=\"docs.page\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://invertase.link/discord\"\u003e\n  \u003cimg src=\"https://img.shields.io/discord/295953187817521152.svg?style=flat-square\u0026colorA=7289da\u0026label=Chat%20on%20Discord\" alt=\"Chat on Discord\"\u003e\n\u003c/a\u003e\n\n## What is it?\n\nSpec builds on-top of existing Dart \u0026 Flutter testing tools to provide a streamlined \u0026 elegant testing environment. Spec provides both a CLI tool\nand Dart package.\n\n- [Documentation](https://docs.page/invertase/spec)\n\n### CLI\n\nThe Spec CLI allows you to run the `spec` command from your CLI environment and run your tests:\n\n- Intuitive testing output interface, inspired by [Jest](https://jestjs.io/).\n- Interactive CLI (via `spec --watch`); automatically re-run tests when source code changes \u0026 rerunning of only failed tests.\n- Run both Dart \u0026 Flutter tests in parallel with a single command.\n- Run tests from multiple packages at the same time using [Melos](https://github.com/invertase/melos).\n\n![spec](https://user-images.githubusercontent.com/5347038/152222814-b036f9bf-59e9-4212-b130-7cb14d50d4cb.gif)\n\n### Package\n\nThe `spec` package provides a different take on how to write tests. Designed with type-safety and IDE autocompletion in mind, spec alters the way you\nwrite your tests to be more declarative, less error prone and force good habits.\n\n## Getting Started\n\n### Matchers\n\nSpec CLI works alongside normal Dart `test` matchers, however also ships with custom matchers, see the [API reference docs](https://pub.dev/documentation/spec/latest/spec/spec-library.html).\n\n**Example of testing using Spec matchers**:\n\n```dart\nimport 'package:spec/spec.dart';\n\nvoid main() {\n  test('future example', () async {\n    final future = Future.value(42);\n    expect(future).toEqual(future);\n    await expect(future).completion.toEqual(42);\n    await expect(future).throws.isArgumentError();\n  });\n\n  test('stream example', () async {\n    final stream = Stream.value(42);\n    await expect(stream).emits.toEqual(42);\n    await expect(stream).emits.isNull();\n    await expect(stream).emits.not.isNull();\n    await expect(stream).emitsError.isArgumentError();\n  });\n\n  test('function example', () {\n    void throwsFn() =\u003e throw Error();\n    expect(throwsFn).returnsNormally();\n    expect(throwsFn).throws.isArgumentError();\n  });\n}\n```\n\n### CLI\n\n#### Installation\n\n```bash\ndart pub global activate spec_cli\n```\n\n#### Usage\n\n**Run tests**:\n\n```bash\nspec\n```\n\n**Run tests in interactive mode**:\n\n```bash\nspec --watch\n```\n\nInteractive mode supports a number of keyboard shortcuts:\n\n```\nWatch Usage:\n › Press f to run only failed tests.\n › Press t to filter by a test name regex pattern.\n › Press q to quit watch mode.\n › Press Enter to trigger a test run.\n```\n\n### GitHub Action\n\nIf you want to use Spec in your GitHub actions pipeline you can utilize the\n[Spec GitHub action](https://github.com/marketplace/actions/spec-action), instructions for\nhow to use it can be found on the the `spec-action`'s marketplace page and in its\n[repository](https://github.com/bluefireteam/spec-action).\n\n---\n\n[LICENSE](/LICENSE)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://invertase.io/?utm_source=readme\u0026utm_medium=footer\u0026utm_campaign=spec\"\u003e\n    \u003cimg width=\"75px\" src=\"https://static.invertase.io/assets/invertase/invertase-rounded-avatar.png\"\u003e\n  \u003c/a\u003e\n  \u003cp align=\"center\"\u003e\n    Built and maintained by \u003ca href=\"https://invertase.io/?utm_source=readme\u0026utm_medium=footer\u0026utm_campaign=spec\"\u003eInvertase\u003c/a\u003e.\n  \u003c/p\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":["Dart"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvertase%2Fspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvertase%2Fspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvertase%2Fspec/lists"}