https://github.com/berasumitdev/unit-testing
Write some unit testing code using jest for learning purpose.
https://github.com/berasumitdev/unit-testing
javascript jest
Last synced: about 2 months ago
JSON representation
Write some unit testing code using jest for learning purpose.
- Host: GitHub
- URL: https://github.com/berasumitdev/unit-testing
- Owner: berasumitdev
- Created: 2024-10-03T07:17:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-03T07:19:58.000Z (over 1 year ago)
- Last Synced: 2025-08-20T06:46:30.543Z (10 months ago)
- Topics: javascript, jest
- Language: JavaScript
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## step 1:
```bash
mkdir my-jest-project
cd my-jest-project
npm init -y
```
## step 2:
```bash
npm install --save-dev jest
```
## step 3:
Goto package.json file
```bash
{
"scripts": {
"test": "jest"
}
}
```
## Writing Your First Test
Create a new directory called tests and add a test file, for example, `sum.test.js`
```bash
mkdir tests
touch tests/sum.test.js
```
## Running Your Tests
To run your tests, use the following command:
```bash
npm test
```