-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
libxmljs doesn't work properly under Jest #8636
Comments
As far as I managed to investigate the problem, it comes down to this: Element.prototype.get = function() {
var res = this.find.apply(this, arguments);
if (res instanceof Array) {
return res[0];
} else {
return res;
}
}; It returns the same Array object when executed by node.js or within jest test, res instanceof Array when executed by bare node.js returns true as it should, |
Based on your comment about |
Yeah, it's definitely caused by #2549 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
libxmljs package doesn't work properly when used in Jest test
To Reproduce
Try to run test:
Expected behavior
It's expected to pass, but It's failing with error:
The same code run by node.js works just fine and returns 'element'
Link to repl or repo
Minimal repository to reproduce bug: https://github.com/frei-0xff/jest-libxmljs-issue
Run
npx envinfo --preset jest
The text was updated successfully, but these errors were encountered: