This looks like a great tool but I've been unable to get it working with the latest version of Chrome. Is this project still supported/in use? If not, do you have some other way you've been debugging DOM elements in jsDom?
I've tried your setup steps and the manual test steps outlined in your development README but the formatter no longer recognizes HTML elements. The isElement() function never returns true for me when I run console.log(exampleNode) from the breakpoint in jest.test.js. Trying to debug that is a bit tricky since the console doesn't break on debugger statements in the header function.
I've noticed that the x parameter passed to the header function seems to be an object wrapping the console log arguments rather than the arguments themselves. I'm not sure if that's something weird with my setup.
// jest.test.js
let exampleNode = document.getElementById("root");
expect(exampleNode).toBeDefined();
console.log(exampleNode);
debugger;
...
// header.js
module.exports = x => {
if (!isElement(x)) {
console.log(
'NOT AN ELEMENT',
typeof(x),
Object.keys(x),
x.exampleNode && x.exampleNode.nodeType
); // --> NOT AN ELEMENT object [ 'exampleNode' ] 1
// i.e. use normal formatter
return null;
}
...
}
As you can see, Object.keys(x) returns an object that has the key 'exampleNode' which is the HTMLElement to log.
Is this something strange with my environment? I'd love to get this working because it would be so helpful when debugging jest tests.
This looks like a great tool but I've been unable to get it working with the latest version of Chrome. Is this project still supported/in use? If not, do you have some other way you've been debugging DOM elements in jsDom?
I've tried your setup steps and the manual test steps outlined in your development README but the formatter no longer recognizes HTML elements. The
isElement()function never returns true for me when I runconsole.log(exampleNode)from the breakpoint injest.test.js. Trying to debug that is a bit tricky since the console doesn't break on debugger statements in theheaderfunction.I've noticed that the
xparameter passed to theheaderfunction seems to be an object wrapping the console log arguments rather than the arguments themselves. I'm not sure if that's something weird with my setup.As you can see,
Object.keys(x)returns an object that has the key 'exampleNode' which is the HTMLElement to log.Is this something strange with my environment? I'd love to get this working because it would be so helpful when debugging jest tests.