I've been working on configuring tests that utilize Jasmine and Karma to test my JavaScript code. Karma operates in Node.js and initiates a Chrome browser for testing purposes.
Unfortunately, I keep encountering an error message that reads "Chrome 28.0 (Windows) ERROR Script error. at :0" After investigating further, I discovered that certain objects created within my code trigger cross-domain AJAX calls which cause my Karma tests to crash.
Although the success of these AJAX calls is not crucial for the overall success of my tests, I would prefer if they did not lead to crashes in Karma.
I am exploring various solutions for this issue. Is it possible to adjust settings in Karma/Chrome to prevent the AJAX calls from failing catastrophically? Can I potentially override XMLHttpRequest to either block the problematic requests or prevent any requests altogether?
Additional Notes: The test does not fail when viewed in the debug window, despite still making cross-domain AJAX requests.
While I have implemented a testing library that overrides jQuery's AJAX functionality, another library in use continues to make its own AJAX requests.