boot.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * Jasmine 2.0 standalone `boot.js` modified for Karma.
  3. * This file is registered in `index.js`. This version
  4. * does not include `HtmlReporter` setup.
  5. */
  6. ;(function (global) {
  7. /* global jasmineRequire */
  8. 'use strict'
  9. /**
  10. * Require Jasmine's core files. Specifically, this requires and
  11. * attaches all of Jasmine's code to the `jasmine` reference.
  12. */
  13. var jasmine = jasmineRequire.core(jasmineRequire)
  14. /**
  15. * Obtain the public Jasmine API.
  16. */
  17. var jasmineInterface = jasmineRequire.interface(jasmine, jasmine.getEnv())
  18. /**
  19. * Setting up timing functions to be able to be overridden.
  20. * Certain browsers (Safari, IE 8, PhantomJS) require this hack.
  21. */
  22. /* eslint-disable no-self-assign */
  23. global.setTimeout = global.setTimeout
  24. global.setInterval = global.setInterval
  25. global.clearTimeout = global.clearTimeout
  26. global.clearInterval = global.clearInterval
  27. /* eslint-enable no-self-assign */
  28. /**
  29. * Add all of the Jasmine global/public interface to the proper
  30. * global, so a project can use the public interface directly.
  31. * For example, calling `describe` in specs instead of
  32. * `jasmine.getEnv().describe`.
  33. */
  34. for (var property in jasmineInterface) {
  35. if (Object.prototype.hasOwnProperty.call(jasmineInterface, property)) {
  36. global[property] = jasmineInterface[property]
  37. }
  38. }
  39. }(typeof window !== 'undefined' ? window : global))