{"id":13495585,"url":"https://github.com/cometkim/rescript-vitest","last_synced_at":"2025-10-07T00:47:16.860Z","repository":{"id":37772699,"uuid":"448489152","full_name":"cometkim/rescript-vitest","owner":"cometkim","description":"ReScript bindings to Vitest","archived":false,"fork":false,"pushed_at":"2025-06-25T07:30:52.000Z","size":5337,"stargazers_count":53,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-23T18:32:33.739Z","etag":null,"topics":["rescript","rescript-bindings","vite","vitest"],"latest_commit_sha":null,"homepage":"","language":"ReScript","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/cometkim.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2022-01-16T07:43:58.000Z","updated_at":"2025-08-20T07:02:04.000Z","dependencies_parsed_at":"2023-11-25T09:41:19.948Z","dependency_job_id":"b56a407e-98f6-4a77-bd94-f29bfc413acd","html_url":"https://github.com/cometkim/rescript-vitest","commit_stats":{"total_commits":84,"total_committers":8,"mean_commits":10.5,"dds":"0.11904761904761907","last_synced_commit":"e4f24e46ad66fc0ab3c8c1797958a92a84a9e8a6"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/cometkim/rescript-vitest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Frescript-vitest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Frescript-vitest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Frescript-vitest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Frescript-vitest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cometkim","download_url":"https://codeload.github.com/cometkim/rescript-vitest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Frescript-vitest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278703583,"owners_count":26031205,"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-06T02:00:05.630Z","response_time":65,"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":["rescript","rescript-bindings","vite","vitest"],"created_at":"2024-07-31T19:01:36.196Z","updated_at":"2025-10-07T00:47:16.854Z","avatar_url":"https://github.com/cometkim.png","language":"ReScript","funding_links":[],"categories":["ReScript"],"sub_categories":[],"readme":"# rescript-vitest\n\n[![npm](https://img.shields.io/npm/v/rescript-vitest)](https://www.npmjs.com/package/rescript-vitest)\n[![npm downloads](https://img.shields.io/npm/dm/rescript-vitest)](https://www.npmjs.com/package/rescript-vitest)\n[![license](https://img.shields.io/github/license/cometkim/rescript-vitest)](#LICENSE)\n\n[ReScript](https://rescript-lang.org) bindings to [Vitest](https://vitest.dev)\n\n## Prerequisite\n\nReScript v10.1+ is required since v1.0.0. To use `Js.Promise2` and `async`/`await` for tests.\n\nReScript v11.x with the [uncurried mode](https://rescript-lang.org/blog/uncurried-mode) is supported since v2.x.\n\n## Config\n\nConfigure with plain `vite.config.js`.\n\nYou can use [vite-plugin-rescript](https://github.com/jihchi/vite-plugin-rescript) to build ReScript automatically before the test.\n\n## Usage\n\nYou can find examples on [tests](./tests)\n\n### Basic\n\n```res\nopen Vitest\n\ndescribe(\"Hello, Vitest\", () =\u003e {\n  test(\"This is a test case\", t =\u003e {\n    // t is `expect` object for suite-wide assertions\n    t-\u003eassertions(3)\n\n    // Test using the `Expect` module\n    t-\u003eexpect(1 + 2)-\u003eExpect.toBe(3)\n\n    // There are some nested modules for specific type\n    t-\u003eexpect([1, 2, 3])\n    -\u003eExpect.Array.toContain(2)\n\n    t-\u003eexpect(\"Hello, ReScript-Vitest!\")\n    -\u003eExpect.String.toContain(\"ReScript\")\n\n  // You can specify timeout for a test suite\n  }, ~timeout=2000)\n})\n```\n\n### In-source testing (experimental)\n\nVitest support [in-source testing](https://vitest.dev/guide/in-source)\n\n```res\n// This if block can be removed from production code.\n// You need to define `import.meta.vitest` to `undefined`\nif Vitest.inSource {\n  open Vitest.InSource\n\n  test(\"In-source testing\", t =\u003e {\n    t-\u003eexpect(1 + 2)-\u003eExpect.toBe(3)\n  })\n}\n```\n\n### Migration from 1.x\n\nYou need to bind test context `t` explicitly.\n\n```diff\nopen Vitest\n\ndescribe(\"Hello, Vitest\", () =\u003e {\n-  test(\"This is a test case\", _ =\u003e {\n+  test(\"This is a test case\", t =\u003e {\n\n-    assertions(3)\n+    t-\u003eassertions(3)\n\n-    expect(1 + 2)-\u003eExpect.toBe(3)\n+    t-\u003eexpect(1 + 2)-\u003eExpect.toBe(3)\n  })\n})\n```\n\nYou can use simple flags for `skip`, `concurrent`, and `only`.\n\n```res\nSkip.test(\"This will be skipped\", t =\u003e {\n  // ...\n})\n\n// Use simple flags instead.\ntest(~skip=true, \"This will be skipped\", t =\u003e {\n  // ...\n})\n```\n\nModule bindings will be deprecated and removed in next major (v3)\n\n## LICENCE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometkim%2Frescript-vitest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcometkim%2Frescript-vitest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometkim%2Frescript-vitest/lists"}