Skip to content

Commit 5dc229f

Browse files
committed
more detailed error message
1 parent 70aa45c commit 5dc229f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default class File extends Blob {
1111
*/ // @ts-ignore
1212
constructor(fileBits, fileName, options = {}) {
1313
if (arguments.length < 2) {
14-
throw new TypeError(`Failed to construct 'File': 2 arguments required.`);
14+
throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);
1515
}
1616
super(fileBits, options);
1717

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,6 @@ test('blobFrom(path) sets empty type', async t => {
319319
test('new File() throws with too few args', t => {
320320
t.throws(() => new File(), {
321321
instanceOf: TypeError,
322-
message: 'Failed to construct \'File\': 2 arguments required.'
322+
message: 'Failed to construct \'File\': 2 arguments required, but only 0 present.'
323323
});
324324
});

0 commit comments

Comments
 (0)