-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for file not found #9
base: master
Are you sure you want to change the base?
Conversation
@cristianvasquez can you replace the |
However, that will not throw exceptions. Is that expected? |
I've added the (failing) test in to branch |
const { promisify } = require('util')
const { finished } = require('readable-stream')
// line after stream.resume()
await promisify(finished)(stream) |
test/fromFile.test.js
Outdated
it('should throw an error if the file extension is unknown', async () => { | ||
await assert.rejects( | ||
async () => { | ||
fromFile('test.jpg') |
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.
A sync error is thrown and throws()
should be used. An await
would be required if an async error is thrown.
test/fromFile.test.js
Outdated
it('should throw an error if the media type is unknown', async () => { | ||
await assert.rejects( | ||
async () => { | ||
fromFile('test.jpg', { |
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.
Same here, a sync error is thrown.
# Conflicts: # test/fromFile.test.js
I did the changes as requested thanks for the review, I learned some things. |
I thought this component was not handling that part but it appears to work. :)
#8