An open API service indexing awesome lists of open source software.

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.

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
```