-
-
Notifications
You must be signed in to change notification settings - Fork 772
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
Upgrading to Sinon 2.1.0 resulted in "HTMLElement is not defined" error #1377
Comments
I am also seeing this issue since upgrading to 2.1.0. I also see it on 2.0.0. Downgrading to 1.17.7 fixes the issue. |
Also seeing the same thing, but we're running our tests in Node using Ava. |
I also encountered a similar error as @GentlemanHal
As a workaround I used |
I've experienced the same issue, but setting the My setup includes populating import { jsdom } from 'jsdom';
const document = jsdom('');
// properties must be extracted from a document that was created that does not
// use a vm context.
const properties = Object.getOwnPropertyNames(
jsdom('', { features: { ProcessExternalResources: false } }).defaultView
);
properties.forEach((property: string) => {
if (typeof global[property] === 'undefined') {
global[property] = document.defaultView[property];
}
}); |
Oh, also, this should probably be closed since it does seem to be a |
Closing this. Thank you all for contributions :) |
@mroderick should we close this before we have upgraded our dependencies? not that the issue is with us, but we are still affected by it. |
If you are suffering from this error, here is a clean way to solve it across all tests
|
A PR for |
@chaijs/type-detect v4.0.5 just got released. |
@mroderick No point in pushing a new version of Sinon. It won't fix anything for consumers. This is automatically fixed by To me, this issue should just be closed. |
This includes a fix for sinonjs#1377
This includes a fix for sinonjs#1377
I've actually solved the issue for myself but wanted to raise this in case others had the same issue.
Sorry if this is just creating noise for the team. Is there be a better way to document these kind of things in the future?
What did you expect to happen?
After reading the migration guide and the docs I expected everything to carry on working as I wasn't using any removed functionality.
What actually happens
Several tests failed with the error
HTMLElement is not defined
.My solution
I need a DOM to test some of our React components so the
type-detect
module was entering theisDom
block and then failing. I was able to fix this by adding the following to the script that creates the virtual DOM for my tests:The commit with the upgrade.
Note: This wasn't an issue in 1.x and I haven't done any investigation as to what changed in 2.x to result in this issue.
The text was updated successfully, but these errors were encountered: