global.js 759 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* globals window, document */
  6. /**
  7. * @module utils/dom/global
  8. */
  9. /**
  10. * A helper (module) giving an access to the global DOM objects such as `window` and
  11. * `document`. Accessing these objects using this helper allows easy and bulletproof
  12. * testing, i.e. stubbing native properties:
  13. *
  14. * import global from 'ckeditor5/utils/dom/global.js';
  15. *
  16. * // This stub will work for any code using global module.
  17. * testUtils.sinon.stub( global, 'window', {
  18. * innerWidth: 10000
  19. * } );
  20. *
  21. * console.log( global.window.innerWidth );
  22. */
  23. export default { window, document };