8
0

common.js 870 B

12345678910111213141516171819202122
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* global console */
  6. // eslint-disable-next-line mocha/no-top-level-hooks
  7. before( () => {
  8. // This is a temporary special handling for https://github.com/ckeditor/ckeditor5/issues/8263
  9. // The goal is to show which test case(s) exactly causes the "Selection change observer detected an infinite rendering loop." warn
  10. // and reduced engine code coverage.
  11. const originalWarn = console.warn;
  12. console.warn = function( ...args ) {
  13. if ( args[ 0 ] == 'Selection change observer detected an infinite rendering loop.' ) {
  14. throw new Error( 'Detected unwelcome "Selection change observer detected an infinite rendering loop." warning.' );
  15. }
  16. return originalWarn.apply( args );
  17. };
  18. } );