{"id":27296291,"url":"https://github.com/rickdgeerling/nest-cucumber","last_synced_at":"2025-04-11T23:35:03.125Z","repository":{"id":71573880,"uuid":"578970479","full_name":"rickdgeerling/nest-cucumber","owner":"rickdgeerling","description":"Structure Cucumber tests with NestJS","archived":false,"fork":false,"pushed_at":"2024-10-31T06:01:19.000Z","size":188,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T19:39:02.848Z","etag":null,"topics":["bdd","cucumber","nestjs","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/rickdgeerling.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}},"created_at":"2022-12-16T10:32:25.000Z","updated_at":"2023-06-30T08:56:46.000Z","dependencies_parsed_at":"2024-01-07T15:26:35.227Z","dependency_job_id":"dd49ea32-f6f0-4a9a-89e8-8742c6640dcc","html_url":"https://github.com/rickdgeerling/nest-cucumber","commit_stats":null,"previous_names":["rickdgeerling/nest-cucumber"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickdgeerling%2Fnest-cucumber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickdgeerling%2Fnest-cucumber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickdgeerling%2Fnest-cucumber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickdgeerling%2Fnest-cucumber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rickdgeerling","download_url":"https://codeload.github.com/rickdgeerling/nest-cucumber/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248496856,"owners_count":21113905,"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":["bdd","cucumber","nestjs","testing"],"created_at":"2025-04-11T23:35:02.633Z","updated_at":"2025-04-11T23:35:03.116Z","avatar_url":"https://github.com/rickdgeerling.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nest-Cucumber\n\nThis library is inspired by\n[cucumber-tsflow](https://github.com/timjroberts/cucumber-js-tsflow), but\nleveraging NestJS as a dependency-injection container instead. This allows for\na very lean implementation and is compatible with a wide array of community\nmodules.\n\n**NOTE:** This library is experimental, please report any bugs you encounter\n\n## Usage\n\n1. Install the library with your favourite package manager (e.g.: `npm install --dev @tuxmachine/nest-cucumber`)\n2. Create an entry file to bootstrap your tests:\n\n```ts\nimport { bootstrap } from '@tuxmachine/nest-cucumber';\nimport { AppModule } from './support/app.module';\n\nbootstrap(AppModule);\n```\n\n3. Start writing tests with decorators 🎉 like [this](./tests/support/step-definitions/scenario-scoped-suite.steps.ts)\n\n```ts\n@Suite()\nexport class SumSteps {\n  private result: number;\n  private numbers: number[] = [];\n\n  @Given('we have an input number {int}')\n  addNumber(value: number) {\n    this.numbers.push(value);\n  }\n\n  @When('we calculate their sum')\n  calculate() {\n    this.result = this.numbers.reduce((x, y) =\u003e x + y);\n  }\n\n  @Then('it should return {int}')\n  verify(expected: number) {\n    assert.equal(this.result, expected);\n  }\n}\n```\n\n## Notes\n\n- Make sure you configure Cucumber to run with ts-node, check this repo's\n  [`cucumber.js`](./cucumber.js) for an example\n- Suites are scenario-scoped by default, mirroring NestJS request-scoped, and\n  fresh instances are created for every scenario.\n- BeforeAll and AfterAll steps run outside a scenario and thus cannot run\n  inside scenario-scope. Make sure they're defined on a static provider.\n- If you want to set a custom world, make sure you extend the NestWorld, the\n  scenario-scoping depends on it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickdgeerling%2Fnest-cucumber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frickdgeerling%2Fnest-cucumber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickdgeerling%2Fnest-cucumber/lists"}