{"id":22345850,"url":"https://github.com/mdubourg001/geste","last_synced_at":"2026-04-11T21:37:26.549Z","repository":{"id":102935813,"uuid":"449068411","full_name":"mdubourg001/geste","owner":"mdubourg001","description":"An (incomplete) test runner based on esbuild aiming be to be a faster drop-in replacement to Jest","archived":false,"fork":false,"pushed_at":"2024-11-19T20:55:53.000Z","size":419,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-05T05:48:53.017Z","etag":null,"topics":["jest","replacement","test-runner","tests","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mdubourg001.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":"2022-01-17T22:35:43.000Z","updated_at":"2024-11-19T20:55:57.000Z","dependencies_parsed_at":"2025-01-31T11:42:03.452Z","dependency_job_id":"adfb3cb1-a1eb-4cc2-9911-9d6a90cf8ed7","html_url":"https://github.com/mdubourg001/geste","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/mdubourg001/geste","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdubourg001%2Fgeste","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdubourg001%2Fgeste/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdubourg001%2Fgeste/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdubourg001%2Fgeste/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdubourg001","download_url":"https://codeload.github.com/mdubourg001/geste/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdubourg001%2Fgeste/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31696743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"ssl_error","status_checked_at":"2026-04-11T21:17:24.556Z","response_time":54,"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":["jest","replacement","test-runner","tests","typescript"],"created_at":"2024-12-04T09:18:55.826Z","updated_at":"2026-04-11T21:37:26.530Z","avatar_url":"https://github.com/mdubourg001.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"shots/geste-2-es.png\" alt=\"geste\" height=\"200\" /\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n  (wip) test runner based on \u003ca href=\"https://esbuild.github.io\"\u003eesbuild\u003c/a\u003e\u003cbr\u003e aiming be to be a \u003cb\u003efaster drop-in replacement\u003c/b\u003e to Jest.\u003cbr\u003e\u003cbr\u003e\n  \u003cb\u003eThis project is still WIP, and I'd be glad to receive issues/PRs to help improve it.\u003c/b\u003e\n\u003c/div\u003e\n\n## Features\n\n- Drop-in replacement to Jest\n- TypeScript and JSX support out of the box\n- Supa-fast compilation of test files\n- Support of async tests\n- Support of both ESM and CJS syntaxes\n- Built-in support of benchmark tests\n\n## Installation\n\n```bash\nnpm install --save-dev geste-test\n```\n\n## Usage\n\nTo run your whole test suite, at the root of your project:\n\n```bash\ngeste\n```\n\nTo run only specific tests:\n\n```bash\ngeste tests/utils/*.ts\n```\n\n### Available options\n\n- `--update-snapshots`: when set, failing `expect.toMatchSnapshot()` assertions will update corresponding snapshot files.\n- `--bench`: run benchmark tests right after unit tests\n- `--only-bench`: run only benchmark tests and ignore unit tests\n\n### Usage with tests needing a DOM\n\nInstall `linkedom` and (optionally) `@testing-library/jest-dom`:\n\n```bash\nnpm install --save-dev linkedom\n# optional: for usage with testing-library\nnpm install --save-dev @testing-library/jest-dom\n```\n\nCreate a `geste.config.ts` file at the root of your project (next to `package.json`):\n\n```ts\n// geste.config.ts\n\nexport default {\n  setupFiles: [\"./setupTests.ts\"],\n};\n```\n\nThen create the `setupTests.ts` file, which will be ran before **each one of your tests** (see https://jestjs.io/docs/configuration#setupfiles-array):\n\n```ts\n// setupTests.ts\n\nimport { parseHTML } from \"linkedom\";\n// optional: for usage with testing-library (run `npm install @testing-library/jest-dom`)\nimport \"@testing-library/jest-dom\";\n\nconst defaultHtml =\n  '\u003c!doctype html\u003e\u003chtml\u003e\u003chead\u003e\u003cmeta charset=\"utf-8\"\u003e\u003c/head\u003e\u003cbody\u003e\u003c/body\u003e\u003c/html\u003e';\n\nconst dom = parseHTML(defaultHtml);\nconst { window } = dom;\nconst { document } = window;\n\n// add missing window.location property\nif (!window.location) {\n  // @ts-ignore\n  window.location = { protocol: \"http\" };\n}\n\n// add missing document.getSelection property\nif (!document.getSelection) {\n  // @ts-ignore\n  document.getSelection = () =\u003e ({});\n}\n\n// add missing window.getComputedStyled property\nif (!window.getComputedStyle) {\n  // https://github.com/mikemadest/jest-environment-linkedom/blob/main/src/get-computed-style-polyfill.js\n  function getComputedStyle(element) {\n    this.el = element;\n\n    this.getPropertyValue = function (prop) {\n      const regExp = /(\\-([a-z]){1})/g;\n      let updatedProp = prop === \"float\" ? \"styleFloat\" : prop;\n\n      if (regExp.test(updatedProp)) {\n        updatedProp = updatedProp.replace(regExp, function (match, ...parts) {\n          return parts[1].toUpperCase();\n        });\n      }\n\n      return element?.currentStyle?.[updatedProp]\n        ? element.currentStyle[updatedProp]\n        : null;\n    };\n\n    return this;\n  }\n\n  window.getComputedStyle = getComputedStyle;\n}\n\n// add missing default width/height of window (1024x768 is JSDOM's default)\nif (!window.innerWidth) {\n  window.innerWidth = 1024;\n}\nif (!window.outerWidth) {\n  window.outerWidth = 1024;\n}\nif (!window.innerHeight) {\n  window.innerHeight = 768;\n}\nif (!window.outerHeight) {\n  window.outerHeight = 768;\n}\n\n// add in global all window's properties that are not already defined\nfor (const key of Object.getOwnPropertyNames(window).filter(\n  (k) =\u003e !k.startsWith(\"_\") \u0026\u0026 !global[k]\n)) {\n  global[key] = window[key];\n}\n\nglobal.document = document;\nglobal.window = window;\nglobal.navigator = window.navigator;\nwindow.console = global.console;\n```\n\n## API\n\n### Test API\n\n**geste's API aims to be the exact same as Jest's:**\n\n- [`describe`](https://jestjs.io/docs/api#describename-fn)\n- [`describe.each`](https://jestjs.io/docs/api#describeeachtablename-fn-timeout)\n- [`describe.skip`](https://jestjs.io/docs/api#describeskipname-fn)\n- [`test`](https://jestjs.io/docs/api#testname-fn-timeout)\n- [`test.each`](https://jestjs.io/docs/api#testeachtablename-fn-timeout)\n- [`test.skip`](https://jestjs.io/docs/api#testskipname-fn)\n- [`it`](https://jestjs.io/docs/api#testname-fn-timeout)\n- [`beforeAll`](https://jestjs.io/docs/api#beforeallfn-timeout)\n- [`afterAll`](https://jestjs.io/docs/api#afterallfn-timeout)\n- [`beforeEach`](https://jestjs.io/docs/api#beforeeachfn-timeout)\n- [`afterEach`](https://jestjs.io/docs/api#aftereachfn-timeout)\n- [`jest.fn`](https://jestjs.io/docs/jest-object#jestfnimplementation)\n- [`jest.resetAllMocks`](https://jestjs.io/docs/jest-object#jestresetallmocks)\n\nHowever this is a WIP project so more APIs will be implemented in the future. Feel free to **fill in an issue** to ask for the APIs you'd like to be implemented in priority.\n\nCheck out the [`examples/`](/examples) folder to see real usages of geste API.\n\n### Benchmark API\n\ngeste also implements a benchmarking API inspired by [Golang's](https://gobyexample.com/testing-and-benchmarking). Benchmark tests are written the same way as unit tests and are launched only when running geste with the `--bench` option (or `--only-bench` to run only benchmark tests).\n\n#### `benchmark: (desc: string, cb: (b: BenchmarkTools) =\u003e any) =\u003e void`:\n\nRegister a benchmark test.\n\n```typescript\nimport { BenchmarkTools } from \"geste-test\";\n\nbenchmark(\"benchmark factorialize\", (b: BenchmarkTools) =\u003e {\n  for (let i = 0; i \u003c b.N; i++) {\n    factorialize(10);\n  }\n});\n```\n\n`geste --bench` will output something like:\n\n```plaintext\ntests/benchmarks.test.ts\nb  benchmark factorialize     20971520     82ns/op     1714ms\n```\n\n- `benchmark factorialize` is the name of the benchmark test\n- `20971520` is the number of times your function was able to run in (at least) **one second** (higher is better)\n- `82ns/op` indicates **how much time each run took** in average (lower is better)\n- `1714ms` is the execution time that was needed to run your function `20971520` times\n\n#### `benchmark.skip: (desc: string, cb: (b: BenchmarkTools) =\u003e any) =\u003e void`\n\nSkip a benchmark test.\n\n#### `benchmark.each: (cases: any[]) =\u003e (desc: string, cb: (b: BenchmarkTools, ...args: any[]) =\u003e any) =\u003e void`\n\nRegister a benchmark test for each case provided. Useful to benchmark a function with various inputs.\n\n```typescript\nbenchmark.each([[10], [100], [1000]])(\"benchmark factorialize(%i)\", (b, n) =\u003e {\n  for (let i = 0; i \u003c b.N; i++) {\n    factorialize(n);\n  }\n});\n```\n\n## Configuration\n\nThis project aims to be a drop-in replacement to Jest, so the configuration options are very much inspired by it.\n\nYou can configure geste's options by creating a `geste.config.ts` file at the root of your project.\n\nThese are the default configuration values:\n\n```ts\n// geste.config.ts\n\nexport default {\n  testPatterns: [\n    \"**/__tests__/**/*.[jt]s?(x)\",\n    \"**/?(*.)+(spec|test).[jt]s?(x)\",\n  ],\n  ignorePatterns: [\"**/node_modules/**/*\"],\n  setupFiles: [],\n  throwOnCompilationErrors: true,\n};\n```\n\nHere are the list of the currently supported configuration options, and their Jest's \"equivalent\":\n\n- `testPatterns`: array of [glob](https://github.com/isaacs/node-glob) patterns used to walk your project's sources and find test files. Equivalent to [Jest's `testMatch`](https://jestjs.io/docs/configuration#testmatch-arraystring)\n- `ignorePatterns`: array of [glob](https://github.com/isaacs/node-glob) patterns that will be ignored when looking for test files. Close to [Jest's `testPathIgnorePatterns`](https://jestjs.io/docs/configuration#testpathignorepatterns-arraystring) but here **it's a array of glob patterns instead of regexp patterns**.\n- `setupFiles`: array of paths to modules that will be compiled and evaluated before every one of your test files. Equivalent to [Jest's `setupFiles`](https://jestjs.io/docs/configuration#setupfiles-array)\n- `throwOnCompilationErrors`: should geste throw if it encounters an error while compiling a test file. Kinda same as setting [Jest's `bail`](https://jestjs.io/docs/configuration#bail-number--boolean) to `true`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdubourg001%2Fgeste","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdubourg001%2Fgeste","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdubourg001%2Fgeste/lists"}