-
Notifications
You must be signed in to change notification settings - Fork 53
Modernization #105
Modernization #105
Conversation
- replace Q.defer with native Promises - use arrow functions
mockfs({ | ||
'/home/user/meme.jpg': Buffer.from([8, 6, 7, 5, 3, 0, 9]), | ||
'/home/user/lol.jpg': Buffer.from([9, 0, 3, 5, 7, 6, 8]), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mock file system available in all tests. any fs.* method will think these are real. key == file, value == file contents
}; | ||
return res(ctx.json(response)); | ||
}), | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mock response handler used for uploadFile
test. As easy as adding more handlers to mock responses for other methods.
BREAKING CHANGE: uploadFile no longer accepts a glob pattern. It now accepts either a single image path or an array of image paths. If you must glob, do it yourself and then pass in the array. This removes an unnecessary complexity from the most important method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaimallea looks good to me!
I was able to successfully run all of the tests on my machine.
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Some minor modernization tweaks. Most important change here is the mocking that makes uploadFile testable
cc @KenEucker if you still have an interest (no pressure)