MCPcopy Create free account
hub / github.com/ckeditor/ckeditor5-react / turnOffErrors

Function turnOffErrors

tests/_utils/turnOffErrors.ts:9–22  ·  view source on GitHub ↗
( callback: () => Awaitable<void> )

Source from the content-addressed store, hash-verified

7import { timeout } from './timeout.js';
8
9export async function turnOffErrors( callback: () => Awaitable<void> ): Promise<void> {
10 const handler = ( evt: ErrorEvent ) => {
11 evt.preventDefault();
12 };
13
14 window.addEventListener( 'error', handler, { capture: true, once: true } );
15
16 try {
17 await callback();
18 await timeout( 150 );
19 } finally {
20 window.removeEventListener( 'error', handler );
21 }
22}

Calls 1

timeoutFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…