https://github.com/jimlynchcodes/request-promise-mockery-example
https://github.com/jimlynchcodes/request-promise-mockery-example
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/jimlynchcodes/request-promise-mockery-example
- Owner: JimLynchCodes
- Created: 2020-01-06T04:32:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T19:24:46.000Z (over 3 years ago)
- Last Synced: 2025-02-04T11:55:19.019Z (over 1 year ago)
- Language: JavaScript
- Size: 106 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Request-Promise-Mockery-Example
Source code for the repl.it project here: https://repl.it/@JimLynch/Request-Promise-Mockery-Example
This project demonstrates specifically how to test a function that loads the [request-promise](https://github.com/request/request-promise) library by using [mockery](https://github.com/mfncooper/mockery) to have the function under test use a mocked response rather than requiring the library and using the real implementation.
More generally, it shows how to use mockery to mock objects and functions that are require'd in other files.