https://github.com/ianhomer/try-jest
Explore Jest - JavaScript test framework
https://github.com/ianhomer/try-jest
explore javascript jest test
Last synced: 11 months ago
JSON representation
Explore Jest - JavaScript test framework
- Host: GitHub
- URL: https://github.com/ianhomer/try-jest
- Owner: ianhomer
- License: bsd-3-clause
- Created: 2021-08-31T16:01:54.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-25T07:18:47.000Z (over 2 years ago)
- Last Synced: 2025-02-09T05:36:28.632Z (about 1 year ago)
- Topics: explore, javascript, jest, test
- Language: TypeScript
- Homepage:
- Size: 1.58 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# try-jest
Try Jest
## Getting started
pnpm install
pnpm test
## Make changes
### TDD
pnpm test:watch
- Write simplest (failing) test that reads like a specification
- Write simplest code to get green
- Commit
- if test fails then **your code is reverted**
- if your code was not covered by tests then **your code is reverted**
- if test passes and commit is OK, then code automatically pushed to origin
- if you haven't been correcting lint errors in your editor then push will be
rejected
- Refactor code to make it beautiful (and commit)
- Repeat and create all tests that you can think that should fail for your
specification

### TDD katas
Read
### TCR
As with TDD flow above, but no peaking. When you commit, if change is no good,
you loose the change, but gain wisdom. If all good then straight to remote trunk
to share the goodness.
For TCR experience in `package.json` change the following.
"pre-commit": "lint-staged --quiet && npm test || (git reset --hard HEAD && exit 1)"