-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File upload fails in happy-dom #940
Comments
The environment doesn't implement class FileList {
readonly length: 0;
readonly item: (index: number) => undefined;
readonly [Symbol.iterator] = function* next() {};
}
Object.defineProperty(globalThis, "FileList", {
configurable: true,
enumerable: false,
get: () => FileList
}); The environment also incorrectly implements Object.defineProperty(input, "files", {
configurable: true,
enumerable: false,
get: () => new FileList()
}); This is not a bug with |
Hi Philipp, Thanks, can confirm the workarounds work. For my education/amusement, what does 'this environment' mean? All of it? ( Either way, thanks |
From the |
🎉 This issue has been resolved in version 14.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@all-contributors add @DGollings bug |
I've put up a pull request to add @DGollings! 🎉 |
Reproduction example
https://codesandbox.io/s/wonderful-shadow-zqehu0
Prerequisites
Open a new terminal
npx vitest
Expected behavior
Test passes
Actual behavior
Test fails - but edit vite.config.ts to
jsdom
and it'll passUser-event version
14.1.1
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
Not sure if this has anything to do with user-event, but it might be related to testing-library/vue-testing-library#267 ? I seem to run into all kinds of minor/weird issues using this 'stack'
The text was updated successfully, but these errors were encountered: