/tdd-course-js

Code I usually use on the TDD courses I give out at the office. Use at will.

Primary LanguageJavaScriptMIT LicenseMIT

Welcome to tdd-course-js 👋

Version Documentation Maintenance License: MIT

tdd-course-js is Javascript code I use on my TDD course where I teach people how to think unit testing and how to do TDD.

About npm-package-scaffolding

This project has been started by using https://github.com/h-4vok/npm-package-scaffolding which is the way I like to build JS projects.

About tdd-course-js

I love using the valid brackets string problem from hackerrank (https://www.hackerrank.com/challenges/balanced-brackets/problem) and leetcode (https://leetcode.com/problems/valid-parentheses/). In this course I take people into the journey of solving this issue using javascript and thinking on their unit testing first.

My choices (inherited from using npm-package-scaffolding)

  • ESLint for linting is a must for me. ESLint allows you to build a DOCUMENT with rules which make up your coding standard. This is a coding standard you can EXECUTE. The best kind of documentation.
  • JEST for unit testing. This is a no-brainer. I am a big fan of JEST and how easy it made unit testing on javascript. If you have another tool of choice, feel free to fork this repo and change it to your liking!
  • Code Coverage with JEST at 100%. If I am building a package that will be hosted on npmjs for everyone to download then I want to make sure that it is tested at 100%. Exclusions can be made as long as it makes sense. Besides, unit testing drives design for me. While not a TDD practitioner in any way, I am a TDD enthusiast and try to apply it when possible.
  • Prettier and Pretty-Quick. This is by far one of my favorite tools. By being so heavily opinionated you no longer require discussions on how to format code. Between Prettier and ESLint your coding standard and formatting is assured. Now focus on writing readable code.
  • Babel. This is a JavaScript project scaffolding. For small projects like small npm packages plain JavaScript makes a whole sense to me. Other people might choose TS over JS. Guess we need another scaffolding github project for that :). I will build my own if I get to the point I want to build a package on TS.
  • Husky for precommit hooks. I added husky to save myself whenever I commit code. We can be excellent professionals, but we are not excellent RAM memories.
  • Prepublish checks. If you run npm publish then the prepublish script will run, saving you from yourself again.
  • Finally, we got an .editorconfig file. Install editorconfig on your IDE and get the best from both EditorConfig and Prettier. I have configured them both and ESLint to ensure they work gracefully together.

Author

👤 Christian Guzmán

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Christian Guzmán.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator