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
regression 0.12.7: window.Audio
is undefined in environment: jsdom
#1358
Comments
Same issue here, |
Why do you need private properties? We can allow some of them, if they are generally acceptable by the community. |
When you import the JSDOM has a bug somewhere, so when you need to update a selection in the document, then nothing happens because it thinks the Range is created from a different document. I hacked this by using the const implSymbol = Object.getOwnPropertySymbols(window._document)[0]
const prototype = Object.getPrototypeOf(window.getSelection())
prototype.addRange = function (range) {
window.getSelection()[implSymbol]._associateRange(range)
} https://github.com/jsdom/jsdom/blob/04f6c13f4a4d387c7fc979b8f62c6f68d8a0c639/lib/jsdom/living/selection/Selection-impl.js#L87 This issue is not related to Vitest, it was happening with Jest too. I would be glad we could expose the _document variable. I think it won't introduce any issues. As in, Vue is too exposing a lot of private fields. |
Describe the bug
window.Audio
was not undefined below Vitest v0.12.6.It is now undefined in Vitest v0.12.7+.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-gg5jqy?file=test%2Fbasic.test.ts&initialPath=__vitest__
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: