I have the following code being called from inside my test.
update(subject: ISubject, data?: any): void {
let current = this.entries$.get(data.name)
let element = this.elements$.get(data.name)
if (data.button == "ok") {
this.entries$.set(data.name, !current)
}
if (data.button == "cancel") {
if (element) {
let changeEvent: Event= new Event("change", { bubbles: true, cancelable: true })
element.dispatchEvent(changeEvent)
}
}
}
I've debugged the code and at some point JSDOM verifies the argument to dispatchEvent and launches an exception. Is there any workaround for this?