{"id":13307257,"url":"https://github.com/wartman/medic","last_synced_at":"2026-02-23T08:06:13.648Z","repository":{"id":79327611,"uuid":"173497673","full_name":"wartman/medic","owner":"wartman","description":" A bare-bones unit testing framework.","archived":false,"fork":false,"pushed_at":"2021-08-17T16:19:32.000Z","size":29,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T00:53:56.344Z","etag":null,"topics":["haxe","testing","unit-testing"],"latest_commit_sha":null,"homepage":null,"language":"Haxe","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wartman.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-02T20:51:56.000Z","updated_at":"2021-08-17T16:19:35.000Z","dependencies_parsed_at":"2023-03-01T13:16:09.963Z","dependency_job_id":null,"html_url":"https://github.com/wartman/medic","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/wartman/medic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wartman%2Fmedic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wartman%2Fmedic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wartman%2Fmedic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wartman%2Fmedic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wartman","download_url":"https://codeload.github.com/wartman/medic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wartman%2Fmedic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29739797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: 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":["haxe","testing","unit-testing"],"created_at":"2024-07-29T18:00:15.558Z","updated_at":"2026-02-23T08:06:13.631Z","avatar_url":"https://github.com/wartman.png","language":"Haxe","funding_links":[],"categories":[],"sub_categories":[],"readme":"Medic\n=====\nA bare-bones unit testing framework.\n\nAbout\n-----\n\n`Medic` is a simple unit testing framework for Haxe, designed for\nwhen you don't need anything fancy. It has no dependencies and the\nbare minimum functionality needed, the same as the old `haxe.unit.*`\nframework.\n\nUsage\n-----\n\nTests are based on annotations, and test cases must implement `medic.TestCase`. Assertions are handled by `medic.Assert`, which is best used with `using`. The easiest way to use medic is to simply use `using Medic`, as seen below:\n\n```haxe\npackage test;\n\nusing Medic;\n\nclass FooTest implements TestCase {\n\n  public function new() {}\n\n  @:test.before\n  public function runsBefore() {\n    trace('Methods marked with `@before` will run before every test');\n  }\n\n  @:test.after\n  public function runsAfter() {\n    trace('Methods marked with `@after` will run after every test');\n  }\n\n  @:test('You can put a description of you test here!')\n  public function testFoo() {\n    'foo'.equals('foo');\n  }\n\n  @:test('Medic also allows for simple async tests!')\n  @:test.async(200) // The number here is how long Medic should wait in MS\n  public function testAsync(done) {\n    haxe.Timer.delay(() -\u003e {\n      'foo'.equals('foo');\n      // Call `done` once you've completed your testing! If you don't,\n      // the test will fail. \n      done();\n    }, 200);\n  }\n\n}\n```\n\nTo run tests, simply add your test cases to `medic.Runner`. This should\nall feel familiar if you've used the `haxe.unit.*` framework.\n\n```haxe\nimport medic.Runner;\n\nclass Main {\n\n  public static function main() {\n    var runner = new Runner();\n    runner.add(new test.FooTest());\n    runner.run();\n  }\n\n}\n```\n\nAnd that's basically it! Simple!\n\nAdvanced\n--------\n\nAdding your own assertions:\n\n```haxe\npackage my.test;\n\nimport haxe.PosInfos;\nimport medic.Assert;\nimport medic.AssertionError;\n\nclass ExtraAssert {\n\n  public static function isFoo(item:String, ?p:PosInfos) {\n    Assert.increment(); // This must be called in every assertion, or Medic will\n                        // fail the test and warn that no assertion was detected.\n    if (item != 'foo') {\n      Assert.addError(new AssertionError('${item} should have been foo', p));\n    }\n  }\n\n}\n```\n\nUsing your own `Reporter`:\n\n```haxe\nimport medic.Result;\nimport medic.Runner;\nimport medic.Reporter;\n\nclass Main {\n \n  public static function main() {\n    var runner = new Runner(new MyReporter());\n    // or\n    runner.useReporter(new MyReporter());\n  }\n\n}\n\nclass MyReporter implements Reporter {\n\n  public function new() {}\n\n  public function progress(info:TestInfo) {\n    // Realtime progress can be logged here.\n  }\n\n  public function report(result:Result) {\n    // We won't go into implementation details here -- check\n    // the `medic.DefaultReporter` to get an idea of what's happening,\n    // it's pretty self-explainitory.\n    trace(result);\n  }\n\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwartman%2Fmedic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwartman%2Fmedic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwartman%2Fmedic/lists"}