amphtml
amphtml copied to clipboard
Adding test causes unrelated tests in different file to fail
Adding a simple test to extensions/amp-ad-network-adsense-impl/0.1/test/test-amp-ad-network-adsense-impl.js causes tests in extensions/amp-analytics/0.1/test/test-amp-analytics.js to fail.
To reproduce:
- Make a copy of https://github.com/ampproject/amphtml/pull/16540
- Observe that tests in test-amp-analytics.js fail on Travis.
- Comment out the test in test-amp-ad-network-adsense-impl.js, and re-run all tests.
- Observe that tests in test-amp-analytics.js now pass.
(Note: The above PR changed global sandbox references to env.sandbox. The above steps work with and without doing this.)
After a closer look at the test code, I'm pretty sure the problem is pollution of the global window.
#16592. Globals considered harmful.