boot.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. global.setTimeout = global.setTimeout
  23. global.setInterval = global.setInterval
  24. global.clearTimeout = global.clearTimeout
  25. global.clearInterval = global.clearInterval
  26. /**
  27. * Add all of the Jasmine global/public interface to the proper
  28. * global, so a project can use the public interface directly.
  29. * For example, calling `describe` in specs instead of
  30. * `jasmine.getEnv().describe`.
  31. */
  32. for (var property in jasmineInterface) {
  33. if (jasmineInterface.hasOwnProperty(property)) {
  34. global[property] = jasmineInterface[property]
  35. }
  36. }
  37. }(typeof window !== 'undefined' ? window : global))