Problem
Window exposes VeryHappyFormData, which can populate from a virtual form, but GlobalRegistrator.register() does not replace the host FormData. FormData is absent from OVERRIDE_KEYS, so Bun native FormData remains active and silently ignores the virtual form controls.
Reproduction
import { GlobalRegistrator } from "very-happy-dom"
GlobalRegistrator.register()
document.body.innerHTML = `<form><input name="email" value="test@example.com"></form>`
const data = new FormData(document.querySelector("form")!)
console.log(data.get("email")) // null
console.log(new window.FormData(document.querySelector("form")!).get("email")) // test@example.comImpact
Component tests using the documented global registration appear to submit an empty form. This is especially easy to miss when a test only checks that the submit event fired.
Acceptance
- Registered global
FormDatais the Window implementation. new FormData(virtualForm)includes successful controls.unregister()restores the original host constructor rather than deleting it.