As I work on testing my application, I am facing an issue with loading files using Karma into PhantomJS. The problem arises when one of the files triggers a page reload due to window variables.
The files are being included in this manner:
files: [
'bower_components/angular/angular.js',
'js/**/*.js'
]
Within the main application file (main.js), the following code is causing the issue:
if ( window.top !=== window.self ){
window.location.href = 'someOtherURL.html';
}
// PhantomJS 2.1.1 ERROR
// Some of your tests did a full page reload!
Due to the page reload caused by this particular file, none of my tests are able to run successfully.
Hence, my question is how can I modify the window variables in order to proceed with running this test?