{"id":21007632,"url":"https://github.com/tnzk/jest-gauge","last_synced_at":"2025-05-15T02:31:27.541Z","repository":{"id":57280353,"uuid":"370631706","full_name":"tnzk/jest-gauge","owner":"tnzk","description":"Write executable acceptance tests with Jest, in your mother tongue, just loosely structured in Markdown.","archived":false,"fork":false,"pushed_at":"2021-06-17T14:36:56.000Z","size":338,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-10T06:03:19.731Z","etag":null,"topics":["atdd","gauge","jest","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tnzk.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}},"created_at":"2021-05-25T09:09:50.000Z","updated_at":"2023-06-10T04:14:27.000Z","dependencies_parsed_at":"2022-09-19T15:21:54.211Z","dependency_job_id":null,"html_url":"https://github.com/tnzk/jest-gauge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnzk%2Fjest-gauge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnzk%2Fjest-gauge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnzk%2Fjest-gauge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnzk%2Fjest-gauge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tnzk","download_url":"https://codeload.github.com/tnzk/jest-gauge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254262191,"owners_count":22041347,"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":["atdd","gauge","jest","testing"],"created_at":"2024-11-19T09:09:25.799Z","updated_at":"2025-05-15T02:31:27.146Z","avatar_url":"https://github.com/tnzk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":":warning: **This is an experimental project in very early stage. Try out at your own risk**. Any form of contributions are warmly appreciated as long as you agree to publish the work under [BSD-3 license](./LICENSE).\n\n# jest-gauge\n\nWrite executable acceptance tests (E2E tests) with Jest, in your mother tongue, just loosely structured in Markdown.\n\n## Install and setup\n\nAssuming you're already using [Jest](https://jestjs.io/) for unit testing.\n\nInstall via npm (yarn or other package manager, unconfirmed):\n\n```bash\n$ npm install --save-dev /jest-gauge\n```\n\nAdd `jest.config.gauge.js`:\n\n```js\n// export default { // Use this for mjs instead\nmodule.exports = {\n  roots: ['.'],\n  verbose: true,\n  moduleFileExtensions: ['js', 'spec', 'md'],\n  testMatch: ['**/specs/*.spec', '**/specs/*.md'],\n  transform: {\n    '\\\\.[jt]sx?$': 'babel-jest',\n    \"^.+\\\\.(spec|md)?$\": [ 'jest-gauge', { debug: false } ]\n  }\n};\n```\n\n(we highly recommend to have another config than `jest.config.js` since setup for unit tests and acceptance/E2E tests tend to largely differ).\n\n## Your first acceptance test in Gauge-like Markdown\n\nPut a spec at `$REPO_ROOT/specs/welcome.spec`:\n\n```\n# Specification for the Welcome page\n\nOrdinary paragraphs are treated as comments, just ignored.\n\n## Scenario: Users open the site and see the welcome page\n\n* Open \"https://duckduckgo.com/\"\n* The user sees a cute cucumber-looking white bird\n```\n\nPut steps in `$REPO_ROOT/specs/welcome/steps.js`\n\n```\ntest(\"Open \u003curl\u003e\", (url) =\u003e {\n  expect(url).toBe('https://duckduckgo.com/');\n});\n\ntest(\"The user sees a cute cucumber-looking white bird\", () =\u003e {\n  expect(\"https://duckduckgo.com/assets/logo_homepage.normal.v108.svg\").toContain('duck');\n});\n```\n\nRun tests:\n\n```bash\n$ npx jest --config=jest.config.gauge.js specs/\n```\n\nThen you'll see that it's nicely done:\n\n```\n npx jest --config=jest.config.gauge.js specs/\n\n PASS  examples/welcome.spec\n  Specification for the Welcome page\n    Scenario: Users open the site and see the welcome page\n      ✓ Open \"https://duckduckgo.com/\" (2 ms)\n      ✓ The user sees a cute cucumber-looking white bird\n\nTest Suites: 1 passed, 1 total\nTests:       2 passed, 2 total\nSnapshots:   0 total\nTime:        0.913 s\n```\n\n# Background\n\nI'm interested in [Gauge](https://docs.gauge.org) which looks a quite promising as an ATDD framework, however, it is a little too opinionated to integrate it with an existing project, especially if you have had a bunch of unit and E2E tests in Jest there.\n\nSo I've crafted a Jest extension which can recognize specification files (hopefully) compatible to of Gauge and execute steps you implemented in Jest vocabulary like test/expect among the others.\n\n# TODO\n\n- [ ] Spec\n  - [x] Support `.md` extension\n  - [ ] Support [manifest files](https://docs.gauge.org/writing-specifications.html?os=macos\u0026language=javascript\u0026ide=vscode#manifest-file)\n  - [ ] Support [Env directory](https://docs.gauge.org/writing-specifications.html?os=macos\u0026language=javascript\u0026ide=vscode#env-directory)\n  - [x] Support [data tables](https://docs.gauge.org/writing-specifications.html?os=macos\u0026language=javascript\u0026ide=vscode#table-driven-scenario)\n  - [ ] Step alias\n  - [x] Teardown steps\n- [ ] Steps\n  - [x] Simple parameters\n  - [x] Dynamic parameters with data table\n  - [ ] Dynamic parameters with Concept\n  - [ ] Table parameters\n  - [ ] Special parameters\n    - [ ] File\n    - [ ] Table\n- [x] Scenario\n  - [x] [Table driven scenario](https://docs.gauge.org/writing-specifications.html?os=macos\u0026language=javascript\u0026ide=vscode#table-driven-scenario) (note that it is in experiment as of Gauge 1.0.3)\n  - [x] [Data-driven execution](https://docs.gauge.org/execution.html?os=macos\u0026language=javascript\u0026ide=vscode#data-driven-execution)\n- [ ] Concepts\n- [x] Contexts\n- [ ] Continue on Failure\n- [ ] Execution\n  - [ ] [Execution hooks](https://docs.gauge.org/writing-specifications.html?os=macos\u0026language=javascript\u0026ide=vscode#execution-hooks)\n  - [ ] Tag-based execution filtering\n- [x] Data Store\n  - [x] ScenarioStore\n  - [x] SpecStore\n  - [x] SuiteStore\n- [ ] Taking Custom Screenshots (?)\n- [ ] Examples\n  - [x] Puppeteer integration\n  - [x] Taiko integration (very experimental)\n- [x] Add unit tests\n- [ ] TypeScript\n  - [x] Jest-gauge itself in TypeScript\n  - [ ] Support step implementations in TypeScript (should be satisfiable by using babel-jest altogether)\n- [ ] Jest integration\n  - [x] Implement `getCacheKey`\n  - [x] Debug options\n  - [ ] Entirely skipped specs don't seem to be shown in test results, but why? It'd be nice if skipped specs are shown explicitly.\n  - [x] Support `step` for a steps without any test cases\n  - [ ] Support RawSourceMap; [`source-map`](https://github.com/mozilla/source-map/blob/0.6.1/source-map.d.ts#L6-L12)\n\ncf. https://docs.gauge.org/writing-specifications.html\n\n# 日本語版\n\nまだありません :smiling_face_with_tear:","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnzk%2Fjest-gauge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftnzk%2Fjest-gauge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnzk%2Fjest-gauge/lists"}