js-must
js-must copied to clipboard
Hangs the browser when checking must.be.equal
Hello! Write tests on the button. When clicking on the button - it should be in focus, but due to the button for other reasons does not receive focus and document.activeElement not equal to the button, and equal document.body. In this case, the test was just to fail, but after my code - crashes the browser(any) or does not hang, but is not performed afterEach. My code:
var sliderRunner = $('.slider__runner');
sliderRunner.focus();
sliderRunner.get(0).must.equal(document.activeElement);
I tried in different ways:
sliderRunner.get(0).must.be.equal(document.activeElement);
sliderRunner.get(0).must.eql(document.activeElement); //recursive
Hey!
Thanks for taking the time to let me know about this and sorry about the trouble!
I'm guessing it could be an issue with trying to serialize the DOM element to report the failure (something like foo must equal bar
). I'll take a look and see how to tone down the serialization for cases where it might take too long.
@moll Hi! What is the status of this issue?