https://github.com/harrymt/js-mocking-demo
Example of how to use Stubs, Spies for Mocking JavaScript tests.
https://github.com/harrymt/js-mocking-demo
javascript javascript-tests mocha mock sinonjs spies stub
Last synced: 9 days ago
JSON representation
Example of how to use Stubs, Spies for Mocking JavaScript tests.
- Host: GitHub
- URL: https://github.com/harrymt/js-mocking-demo
- Owner: harrymt
- Created: 2018-03-28T08:42:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-07-21T00:41:21.000Z (almost 4 years ago)
- Last Synced: 2023-08-08T00:49:59.544Z (almost 3 years ago)
- Topics: javascript, javascript-tests, mocha, mock, sinonjs, spies, stub
- Language: JavaScript
- Homepage: https://www.harrymt.com/blog/2018/04/11/stubs-spies-and-mocks-in-js.html
- Size: 9.77 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JavaScript Mocking
Example of how to use Stubs, Spies and Mocks for JavaScript tests.
[Blog Post](https://www.harrymt.com/blog/2018/04/11/stubs-spies-and-mocks-in-js.html) describes how to use this repo.
### Technologies
- [SinonJS](http://sinonjs.org/) (Pronounced "sigh-non")
- [MochaJS](http://mochajs.org)
### Install
```
$ yarn
```
### Basic In-memory storage
Run basic program.
```
$ yarn start
```
Run tests.
```
$ yarn test
```
### Further Reading
- [SinonJS docs](http://sinonjs.org/)