Skip to content

Unit tests with automation examples for GitHub and Git Hooks

Notifications You must be signed in to change notification settings

Vondry/JS-unit-test-examples

Repository files navigation

Educational repo of unit test samples

  • Tests are written using vitest using Jest like assertions.

Implemented features

  • Tests are executed automatically on GitHub using checks.yml workflow

  • Tests are executed automatically before every git push to the remote repository via pre-push Git Hook using Husky

  • For every git commit there is automatically being run (via pre-commit) ESLint that might do some more code improvements and also format code using Prettier

  • All git message are validated by commitlint via commit-msg

    • If your git commit -m "..." fails with husky - commit-msg script failed (code 1), please refer to Conventional Commits and read how professionals write commit messages

Getting started

  • Run npm i in the project root to install vitest

Directories

  • playground - Explains and gives examples of how basic assertions works
  • utils - Includes code samples with test coverage and some practical exercises

Best practices

Please check out list of examples here.

About

Unit tests with automation examples for GitHub and Git Hooks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published