Skip to content

KemingHe/template-ts-cucumber-setup

Repository files navigation

TypeScript BDD Template

Node CI CodeQL codecov

Typescript and Behavior-Driven Development complete boilerplate setup.

How to get the most value out of this?
https://www.linkedin.com/pulse/juggling-cucumberjs-keming-he-648ke

Your one-stop, quick-start to any Node.js 18 and 20+ project, fully customizable with ZERO production dependency restrictions. Ready for high-quality frontend, backend, hobby, or professional development.

Made with love ❤️, and maintained by Keming He, now open for hire! 🌐 Connect with me on LinkedIn:

Link: https://linkedin.com/in/keminghe

Key Features

For complete code review, simply run the following, which includes format, lint, and test (unit and behave):

npm run review

This automation is also baked into the GitHub Actions, validating for both Node.js 18 and 20 versions when main has been modified via push or pull-request. You can modify the workflow at:

.github/workflows/node-ci.yml

Note

Update 04/02/24:

CodeCov reporting has been added to the node-ci.yml workflow.

View the "Sunburst" coverage report of this repository here:

CodeCov report for this repo, visualized in Sunburst format.

The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.

https://app.codecov.io/gh/KemingHe/template-ts-cucumber-setup

Learn how to setup CodeCov for your repos here:

https://docs.codecov.com/docs/quick-start

More pre-defined commands below (and even more in package.json), give them a try!

Command Description Dev Module Config File in Root
npm run format-write Code style revision Prettier .prettierrc.json
npm run lint-fix Code quality revision ESLint .eslintrc.json
npm run build Compile ts TypeScript tsconfig.json
npm run test-unit Unit testing Jest jest.config.json
npm run test-behave Feature testing CucumberJS cucumber.js

Credit: This table was generated using: https://www.tablesgenerator.com/markdown_tables

Big, Deep, Deep Thanks

This tutorial/template is inspired, and made possible, by the these awesome people/communities (unordered). Please follow them on LinkedIn/GitHub and consider sponsoring 💗 or buying them coffee ☕ for their wonderful work:

  • Khalil Stemmler's TypeScript x ESLint blog post1:

  • Khalil Stemmler's TypeScript x ESLint x Prettier blog post2:

  • Paul Ccari's TypeScript x ESLint x Prettier LogRocker blog3:

  • Elliot DeNolf's TypeScript x CucumberJS blog post4:

  • Avsar Yagmur's TypeScript x CucumbetJS x Playwright series5:

  • Tim Robers and the wonderful cucumber-tsflow community6:

  • And GitHub Copilot in VSCode7:

Footnotes

  1. How to use ESLint with TypeScript https://khalilstemmler.com/blogs/typescript/eslint-for-typescript/

  2. How to use Prettier with ESLint and TypeScript in VSCode https://khalilstemmler.com/blogs/tooling/prettier/

  3. Linting in TypeScript using ESLint and Prettier https://blog.logrocket.com/linting-typescript-eslint-prettier/

  4. Cucumber.js with TypeScript https://www.elliotdenolf.com/blog/cucumberjs-with-typescript/

  5. Playwright Test Automation https://medium.com/@avsaryagmurr/list/playwright-test-automation-782786c016e8

  6. cucumber-tsflow https://github.com/timjroberts/cucumber-js-tsflow

  7. GitHub Copilot in VS Code https://code.visualstudio.com/docs/copilot/overview