diff --git a/lib/jasmine-jquery.js b/lib/jasmine-jquery.js index 5f59e437..cb6e2872 100644 --- a/lib/jasmine-jquery.js +++ b/lib/jasmine-jquery.js @@ -259,10 +259,18 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. cache: false, dataType: 'json', url: url, + tryCount: 0, + retryLimit: 3, success: function (data) { self.fixturesCache_[relativeUrl] = data }, error: function ($xhr, status, err) { + this.tryCount++; + if (this.tryCount <= this.retryLimit) { + //try again + $.ajax(this) + return + } throw new Error('JSONFixture could not be loaded: ' + url + ' (status: ' + status + ', message: ' + err.message + ')') } })