File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/@lwc/integration-karma/test/signal/protocol Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ describe('signal protocol', () => {
236236
237237 let caughtError ;
238238
239+ // handle errors thrown both with and without native custom element lifecycle
239240 catchUnhandledRejectionsAndErrors ( ( error ) => {
240241 caughtError = error ;
241242 } ) ;
@@ -246,11 +247,14 @@ describe('signal protocol', () => {
246247
247248 it ( 'does throw an error for objects that throw upon "in" checks' , async ( ) => {
248249 const elm = createElement ( 'x-throws' , { is : Throws } ) ;
249- document . body . appendChild ( elm ) ;
250250
251- // wait 2 ticks for all errors to be caught
252- await new Promise ( setTimeout ) ;
253- await new Promise ( setTimeout ) ;
251+ try {
252+ document . body . appendChild ( elm ) ;
253+ } catch ( err ) {
254+ caughtError = err ;
255+ }
256+
257+ await Promise . resolve ( ) ;
254258
255259 // still renders
256260 expect ( elm . shadowRoot . querySelector ( 'h1' ) . textContent ) . toBe ( 'hello' ) ;
You can’t perform that action at this time.
0 commit comments