diff --git a/lib/jasmine-core/boot.js b/lib/jasmine-core/boot.js index e2e0c86d..12f75f69 100644 --- a/lib/jasmine-core/boot.js +++ b/lib/jasmine-core/boot.js @@ -169,6 +169,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. return specFilter.matches(spec.getFullName()); }; + /** + * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack. + */ + window.setTimeout = window.setTimeout; + window.setInterval = window.setInterval; + window.clearTimeout = window.clearTimeout; + window.clearInterval = window.clearInterval; + /** * ## Execution * diff --git a/lib/jasmine-core/boot/boot.js b/lib/jasmine-core/boot/boot.js index a233a5a1..ec8baa0a 100644 --- a/lib/jasmine-core/boot/boot.js +++ b/lib/jasmine-core/boot/boot.js @@ -147,6 +147,14 @@ return specFilter.matches(spec.getFullName()); }; + /** + * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack. + */ + window.setTimeout = window.setTimeout; + window.setInterval = window.setInterval; + window.clearTimeout = window.clearTimeout; + window.clearInterval = window.clearInterval; + /** * ## Execution * diff --git a/spec/support/dev_boot.js b/spec/support/dev_boot.js index a4bd0385..07b76cf6 100644 --- a/spec/support/dev_boot.js +++ b/spec/support/dev_boot.js @@ -94,6 +94,11 @@ return specFilter.matches(spec.getFullName()); }; + window.setTimeout = window.setTimeout; + window.setInterval = window.setInterval; + window.clearTimeout = window.clearTimeout; + window.clearInterval = window.clearInterval; + var currentWindowOnload = window.onload; window.onload = function() {