Closed septs closed 4 years ago
@brettz9
@brettz9
Sounds good if it can pass our tests. From source, however, it looks like we would need other Node polyfills, or we could only use it for the browser.
I think Blob
, File
and FileList
is browser specific feature.
They can work in Node with jsdom. See our tests.
headless browser is not it a better choice?
Btw, if you meant to suggest headless testing was better than normal Node tests, I think it is good that we have a special environment to show how it can work in regular Node.
Also, this looked like a fine item to add. Just need to see if we can get Node polyfills. Looks like the DataTransfer
API (and the clipboard API) was requested in https://github.com/jsdom/jsdom/issues/1568 where create-file-list
just relies on one of these.
https://github.com/dfahlander/typeson-registry/blob/ee6234e78b672c50a5764f929e4ef8e6466b3c41/types/filelist.js#L16-L43
[[index]]
internal slot e.q:filelist[0] === filelist.item(0)
Array.from(filelist)
see https://www.w3.org/TR/FileAPI/#filelist-section
solution: use https://npm.im/create-file-list package