Skip to content

friendlier cross env test for Blob/Files and overall #29850

@jimmywarting

Description

@jimmywarting

I want to test fetch-blob agains WPT in NodeJS.

To make it more cross environment friendly could you remove this two small test document.body tests into a DOM only environment?

test_first_argument([document.body], 24, "HTMLBodyElement in fileBits"); // "[object HTMLBodyElement]"




Could you also replace the FileReader with the blob.text() and blob.arrayBuffer()? NodeJS do not have a FileReader... Think the FileReader should be tested separately...

var fr = new FileReader();




test_blob & test_blob_binary would be best if it was assigned to globalThis cuz everything runs as a module and isn't assigned to global scope.
Notices testharness have problem detecting the global scope... basically had to do globalThis.self = globalThis before loading testharness.

It would have been nice if more test where written in ESM instead...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions