-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
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?
wpt/FileAPI/file/File-constructor.any.js
Line 44 in e7d848c
| 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...
Line 16 in e7d848c
| 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...