Skip to content
Merged
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
chore: add test case
  • Loading branch information
Gozala authored Nov 2, 2021
commit ccc06b72f3e87aff7e8afa2b50b4e8395079ac49
15 changes: 15 additions & 0 deletions test/parallel/test-blob.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,18 @@ assert.throws(() => new Blob({}), {
});
});
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Based on test/fixtures/wpt/FileAPI/blob/Blob-constructor.any.js
// which is disabled due to dependency on other web APIs.
// Exercises #40705

@aduh95 does this look good ?

(async () => {
const blob = new Blob([
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to have a comment referencing where this test is coming from.

new Uint8Array([0x50, 0x41, 0x53, 0x53]),
new Int8Array([0x50, 0x41, 0x53, 0x53]),
new Uint16Array([0x4150, 0x5353]),
new Int16Array([0x4150, 0x5353]),
new Uint32Array([0x53534150]),
new Int32Array([0x53534150]),
new Float32Array([0xD341500000])
Comment thread
Gozala marked this conversation as resolved.
Outdated
]);

assert.equal(blob.text(), "PASSPASSPASSPASSPASSPASSPASS");
Comment thread
Gozala marked this conversation as resolved.
Outdated
assert.equal(blob.type, "");
Comment thread
Gozala marked this conversation as resolved.
Outdated
})().then(common.mustCall());