Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/catgsmith/jest-tutorial
Various Jest Tests
https://github.com/catgsmith/jest-tutorial
Last synced: about 2 months ago
JSON representation
Various Jest Tests
- Host: GitHub
- URL: https://github.com/catgsmith/jest-tutorial
- Owner: catgsmith
- Created: 2021-06-08T15:32:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-15T08:15:34.000Z (over 3 years ago)
- Last Synced: 2023-10-11T02:29:28.798Z (over 1 year ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Jest
Jest is a delightful JavaScript Testing Framework
## Installation
Install jest locally
```bash
$ mkdir jest_tutorial
$ cd jest_tutorial
$ npm init -y
$ npm install --save-dev jest
```In package.json file set `scripts.test` property to `"jest"`
# Axios
For youTube tutorial `Jest Crash Course - Unit Testing in JavaScript`,
using axios to mock up aysnc tests in `function.js`.```bash
$ npm install --save-dev axios
```## Usage
```bash
npm test
``````bash
npm test mocks
``````bash
npm test spy-mock-implementation.test
``````bash
\\ Jest Crash Course - Unit Testing in JavaScript
npm test functions.test
npm test reverseString.test
npm test chunk.test
npm test anagram.test
```## Resources
https://jestjs.io/docs/en/getting-started.htmlJest Crash Course - Unit Testing in JavaScript
Tutorial : https://www.youtube.com/watch?v=7r4xVDI2vhoTesting with Jest: From zero to hero
Tutorial : https://www.youtube.com/watch?v=NHMIn723hQY
See : zeroToHero.test.jsBlog: Jest .fn() and .spyOn() spy/stub/mock assertion reference
https://codewithhugo.com/jest-fn-spyon-stub-mock/## License
[MIT](https://claddaghcode.com/licenses/mit/)