Skip to content

Created a File Class #97

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

Merged
merged 8 commits into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more detailed error message
  • Loading branch information
jimmywarting committed May 28, 2021
commit 5dc229f3459a91ceb1df3809f8740196ced9d1db
2 changes: 1 addition & 1 deletion file.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class File extends Blob {
*/ // @ts-ignore
constructor(fileBits, fileName, options = {}) {
if (arguments.length < 2) {
throw new TypeError(`Failed to construct 'File': 2 arguments required.`);
throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);
}
super(fileBits, options);

Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,6 @@ test('blobFrom(path) sets empty type', async t => {
test('new File() throws with too few args', t => {
t.throws(() => new File(), {
instanceOf: TypeError,
message: 'Failed to construct \'File\': 2 arguments required.'
message: 'Failed to construct \'File\': 2 arguments required, but only 0 present.'
});
});