{"id":32306013,"url":"https://github.com/drdejavung/super_test","last_synced_at":"2026-05-09T16:03:58.266Z","repository":{"id":181333730,"uuid":"654793055","full_name":"DrDejaVuNG/super_test","owner":"DrDejaVuNG","description":"Designed to simplify testing of SuperControllers, RxNotifiers and RxTs.","archived":false,"fork":false,"pushed_at":"2024-11-07T13:54:18.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T06:59:36.311Z","etag":null,"topics":["dart","flutter","flutter-apps","flutter-super","super","testing"],"latest_commit_sha":null,"homepage":"https://drdejavu.ng","language":"Dart","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/DrDejaVuNG.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.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}},"created_at":"2023-06-17T01:26:54.000Z","updated_at":"2025-05-14T09:36:58.000Z","dependencies_parsed_at":"2023-07-15T02:46:53.305Z","dependency_job_id":null,"html_url":"https://github.com/DrDejaVuNG/super_test","commit_stats":null,"previous_names":["drdejavung/super_test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DrDejaVuNG/super_test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrDejaVuNG%2Fsuper_test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrDejaVuNG%2Fsuper_test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrDejaVuNG%2Fsuper_test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrDejaVuNG%2Fsuper_test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrDejaVuNG","download_url":"https://codeload.github.com/DrDejaVuNG/super_test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrDejaVuNG%2Fsuper_test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280577137,"owners_count":26354074,"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","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dart","flutter","flutter-apps","flutter-super","super","testing"],"created_at":"2025-10-23T06:59:40.618Z","updated_at":"2025-10-23T06:59:42.543Z","avatar_url":"https://github.com/DrDejaVuNG.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  Credits to \u003ca href=\"https://pub.dev/packages/bloc_test\"\u003ebloc_test\u003c/a\u003e for the orignal model\n\u003c/p\u003e\n\n---\n\n# Super Test\n\nDesigned to simplify testing of SuperControllers, RxNotifiers and RxTs. Developed for the [flutter_super](https://pub.dev/packages/flutter_super) package.\n\n---\n\n## Create a Mock \n\n```dart\nclass MockCounterController extends CounterController {}\n\nclass MockCounterNotifier extends CounterNotifier {}\n```\n\n## Controller Tests\n\nTest case for a `SuperController` object.\n\nThe `testController` function is used to define a test case for a `SuperController` object. It takes various parameters to configure the test case, including the `description` of the test, the `build` function to create the `SuperController` object, functions for handling enable, alive, and disable states, setup and teardown functions, initial state `seed`, actions to perform on the controller, a wait duration, expected outcomes, verification functions, error handling, and optional `tags` for categorization.\n\nExample usage:\n\n```dart\ntestController\u003cMyController, int\u003e(\n  'MyController test',\n  build: MyController.new,\n  state: (controller) =\u003e controller.myState,\n  onEnable: (controller) {\n    // Handle the enable state.\n  },\n  onAlive: (controller) {\n    // Handle the alive state.\n  },\n  onDisable: (controller) {\n    // Handle the disable state.\n  },\n  setUp: () {\n    // Perform setup operations.\n  },\n  seed: () =\u003e 10,\n  act: (controller) async {\n    // Perform actions on the controller.\n  },\n  wait: const Duration(seconds: 1),\n  expect: () =\u003e [10],\n  verify: (controller) async {\n    // Perform additional verifications.\n  },\n  tearDown: () {\n    // Perform teardown operations.\n  },\n);\n```\n\nIn the above example, the [testController] function is used to define a test case for a custom [SuperController] object that holds an integer value. The test case includes a description, a [build] function to create the [SuperController] object, functions to handle the enable, alive, and disable states, setup and teardown functions, an initial state [seed], actions to perform on the controller, a wait duration, expected outcomes, verification functions, and teardown operations. The test case can be executed by running the test suite.\n\nThe [testController] function provides a convenient way to define and organize test cases for [SuperController] objects in unit tests.\n\n## RxT Tests\n\nDefines a test case for a [RxT] object.\n\nThe [testRxT] function defines a test case for a specific [RxT] object, which represents a reactive state container. It allows you to set up the initial state, perform actions on the state, and verify the expected behavior and outcomes.\n\nThe [testRxT] function takes various parameters to configure the test  case, such as the test description, setup and teardown functions, actions to perform on the state, expected outcomes, and error handling. It uses the [test] library from the `test` package to define and run the actual test.\n\nExample usage:\n\n```dart\ntestRxT\u003cint\u003e(\n 'RxT test case',\n build: () =\u003e RxT\u003cint\u003e(0),\n act: (rx) =\u003e rx.value = 10,\n expect: () =\u003e [10],\n);\n```\n\nIn the above example, the [testRxT] function is used to define a test case for an [RxT] object that holds an integer value. The test case sets up the initial state, performs an action by assigning the value 10 to the state, and expects the state to have the value 10. The test case is then run using the [test] library.\n\nThe [testRxT] function simplifies the testing of reactive state containers, allowing you to define clear and concise test cases that cover different scenarios and behaviors of the state.\n\n## RxNotifier Tests\n\nDefines a test case for a [RxNotifier] object.\n\nThe [testRxNotifier] function defines a test case for a specific [RxNotifier] object, which represents a reactive state container. It allows you to set up the initial state, perform actions on the state, and verify the expected behavior and outcomes.\n\nThe [testRxNotifier] function takes various parameters to configure the test case, such as the test description, setup and teardown functions, actions to perform on the state, expected outcomes, and error handling. It uses the [test] library from the `test` package to define and run the actual test.\n\nExample usage:\n\n```dart\ntestRxNotifier\u003cint\u003e(\n 'RxNotifier test case',\n build: () =\u003e RxNotifier\u003cint\u003e(0),\n act: (notifier) =\u003e notifier.value = 10,\n expect: () =\u003e [10],\n);\n```\n\nIn the above example, the [testRxNotifier] function is used to define a test case for an [RxNotifier] object that holds an integer value. The test case sets up the initial state, performs an action by assigning the value 10 to the state, and expects the state to have the value 10. The test case is then run using the [test] library.\n\nThe [testRxNotifier] function simplifies the testing of reactive state containers, allowing you to define clear and concise test cases that cover different scenarios and behaviors of the state.\n\n## Additional Information\n\nFor more information on all the APIs and more, check out the [API reference](https://pub.dev/documentation/super_test/latest).\n\n## Requirements\n\n- Dart 3: \u003e= 3.0.0\n\n## Maintainers\n\n- [Seyon Anko](https://github.com/DrDejaVuNG)\n\n## Credits\n\nAll credits to God Almighty who guided me through the project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrdejavung%2Fsuper_test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrdejavung%2Fsuper_test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrdejavung%2Fsuper_test/lists"}