{"id":13726675,"url":"https://github.com/bloodyowl/reason-test-framework","last_synced_at":"2025-05-07T22:30:27.377Z","repository":{"id":52882400,"uuid":"262160533","full_name":"bloodyowl/reason-test-framework","owner":"bloodyowl","description":"A test framework for Reason compiled to JS with BuckleScript","archived":true,"fork":false,"pushed_at":"2021-04-26T13:17:37.000Z","size":223,"stargazers_count":43,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T15:25:38.516Z","etag":null,"topics":["bucklescript","reasonml","testing","unit-testing"],"latest_commit_sha":null,"homepage":null,"language":"Reason","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/bloodyowl.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-07T21:17:31.000Z","updated_at":"2024-11-05T00:43:30.000Z","dependencies_parsed_at":"2022-09-13T02:23:02.782Z","dependency_job_id":null,"html_url":"https://github.com/bloodyowl/reason-test-framework","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloodyowl%2Freason-test-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloodyowl%2Freason-test-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloodyowl%2Freason-test-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloodyowl%2Freason-test-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bloodyowl","download_url":"https://codeload.github.com/bloodyowl/reason-test-framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252965067,"owners_count":21832816,"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":["bucklescript","reasonml","testing","unit-testing"],"created_at":"2024-08-03T01:03:16.428Z","updated_at":"2025-05-07T22:30:27.005Z","avatar_url":"https://github.com/bloodyowl.png","language":"Reason","funding_links":[],"categories":["Reason"],"sub_categories":[],"readme":"# ~~Reason Test Framework~~\n\n**Archived**: prefer https://github.com/bloodyowl/rescript-test\n\n![Node.js CI](https://github.com/bloodyowl/reason-test-framework/workflows/Node.js%20CI/badge.svg?branch=master)\n\n\u003e A test framework for Reason compiled to JS with BuckleScript\n\n**Reason Test Framework** aims to give a simple API for your tests, making them readable. It produces code that [Jest](https://jestjs.io) can consume.\n\n## Installation\n\nRun the following in your console:\n\n```console\n$ yarn add --dev reason-test-framework\n$ yarn add --dev jest # if you don't have it already\n```\n\nThen add `reason-test-framework` to your `bsconfig.json`'s `bs-dependencies`:\n\n```diff\n {\n   \"bs-dependencies\": [\n+    \"reason-test-framework\"\n   ]\n }\n```\n\n## Usage\n\n```reason\nopen TestFramework;\n\ndescribe(\"TestFramework\", ({test}) =\u003e {\n  test(\"runs simple tests\", ({expect}) =\u003e {\n    expect.int(1 + 1).toBe(2);\n    expect.int(1 + 1 + 1).toBe(3);\n    expect.bool(true).toBe(true);\n    expect.float(1.0).toBeCloseTo(1.0);\n    expect.string(\"hello\").not.toEqual(\"goodbye\");\n    expect.string(\"\").toBeEmpty();\n    expect.arrayOf(Int, [|1, 2, 3|]).toEqual([|1, 2, 3|]);\n    expect.listOf(String, [\"a\", \"b\"]).toEqual([\"a\", \"b\"]);\n    expect.value(Ok(1)).toEqual(Ok(1));\n  });\n\n  test(\"produces snapshots\", ({expect}) =\u003e {\n    expect.string(\"hello\").toMatchSnapshot();\n    expect.value({\"id\": 1}).toMatchSnapshot();\n  });\n});\n```\n\n## ES Modules\n\nIf you use the `es6` or `es6-global` configurations in BuckleScript, you'll need to install `babel-jest` for your tests to run.\n\n## Aknowledgments\n\nThese bindings, which look like [Rely](https://reason-native.com/docs/rely/), were originally shared from the [Reason Native](https://github.com/facebookexperimental/reason-native) repo by [Ben Anderson](https://github.com/bandersongit) 🙏\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloodyowl%2Freason-test-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbloodyowl%2Freason-test-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloodyowl%2Freason-test-framework/lists"}