Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maty21/mockery-partial
mockery partial allows you to mock only part of the method instead of mock every thing
https://github.com/maty21/mockery-partial
Last synced: 16 days ago
JSON representation
mockery partial allows you to mock only part of the method instead of mock every thing
- Host: GitHub
- URL: https://github.com/maty21/mockery-partial
- Owner: maty21
- Created: 2016-09-21T14:24:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-09T14:37:26.000Z (over 8 years ago)
- Last Synced: 2024-12-09T02:11:26.375Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mockery-partial
mockery partial is a fork of the good mockery package with the ability to mock only some methods and keep the functionality of the others. instead of mocking everything so it includes all the functionality of mockery with one new ability ``registerPartial``### usage example
```js
var fsMock = {
stat: function (path, cb) {
cb('yoopi');
}
};
// keep in mind that you can still use other fs modules functionality
// such readFileSync or everything elsemockeryPartial.enable();
mockeryPartial.registerPartial('fs',fsMock);var fs = require('fs');
fs.stat('a',(res)=>{
console.log(res)
})//output -> yoopi
```