Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedvlprs/jest-testing
JavaScript unit testing using Jest
https://github.com/thedvlprs/jest-testing
javascript jest-tests unit-testing
Last synced: about 2 months ago
JSON representation
JavaScript unit testing using Jest
- Host: GitHub
- URL: https://github.com/thedvlprs/jest-testing
- Owner: thedvlprs
- Created: 2019-12-11T12:29:54.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-21T11:19:11.000Z (7 months ago)
- Last Synced: 2024-06-22T04:12:35.197Z (7 months ago)
- Topics: javascript, jest-tests, unit-testing
- Language: JavaScript
- Homepage:
- Size: 1.07 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JavaScript Unit Testing using ***Jest***
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![GitHub contributors](https://img.shields.io/github/contributors/Naereen/StrapDown.js.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/contributors/) [![Open Source Love png1](https://badges.frapsoft.com/os/v1/open-source.png?v=103)](https://github.com/ellerbrock/open-source-badges/) [![saythanks](https://img.shields.io/badge/say-thanks-ff69b4.svg)](https://saythanks.io/to/kennethreitz)
### **Tools**:
- [Visual Studio Code](https://code.visualstudio.com/)
- [Node JS](https://nodejs.org/en/)
- [A guide to unit testing in JS](https://github.com/mawrkus/js-unit-testing-guide/)### **devDependencies**:
- **jest**
### Commands:
```npm init -y```
```npm i -D jest```
```npm test```
---
``` // functions.js > to check test x PASS ```
```javascript
const functions = {
add: (num1, num2) => num1 + num2
};module.exports = functions;
```
![](img/success.png)``` // functions.js > to check test x FAIL ```
```javascript
const functions = {
add: (num1, num2) => num1 + num2 + 1
};module.exports = functions;
```
![](img/fail.png)