-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
global-mode errors fired during mocha tests #3093
Comments
This was a tricky bug to hunt down. Lines 503 to 528 in 438b596
Looking at the trace I found that this happens at Lines 17 to 29 in 438b596
window.mocha is undefined.I found it strange that window.mocha was undefined when in a test but eventually noticed that some tests define an iframe which they run code in: Lines 129 to 215 in 438b596
The problematic test is 'works when p5.js is loaded asynchronously' which accidentally adds a p5 script tag twice: Line 174 in 438b596
Lines 176 to 189 in 438b596
That test breaks if the iframe is created via: createP5Iframe(' '); (which causes it to not automatically inject a p5 script tag) but it does not break if these lines are removed: Lines 183 to 186 in 438b596
To me the load callback looks correct, but apparently it's not.I would love if someone takes over and fixes the test. There are many other things logged when running the tests and I think it would be great if we made sure that tests fail if they have: uncaught errors / lost promisses (even in iframes they create), if they create elements that are not cleaned up, or if they use console.log. I'd like tests to inject their own logger instance (possibly by simply shadowing window.console) and that the test asserts something about the log output. Tests that should log can then keep doing so (and they can assert that it actually happens) and tests that accidentally create warning logs will be detected. |
(current master)
i'm seeing a bunch of global mode binding errors being fired during the global-mode mocha tests. this is happening both in-browser and on the command line (including travis).
The text was updated successfully, but these errors were encountered: