@@ -49,11 +49,12 @@ describe("props validation", () => {
4949
5050 const app = new App ( { test : true } ) ;
5151 let error : OwlError | undefined ;
52- const mountProm = app
53- . createRoot ( Parent )
52+ const root = app . createRoot ( Parent ) ;
53+ const errorProm = nextAppError ( app ) ;
54+ const mountProm = root
5455 . mount ( fixture )
5556 . catch ( ( e : Error ) => ( error = e ) ) ;
56- await expect ( nextAppError ( app ) ) . resolves . toThrow (
57+ await expect ( errorProm ) . resolves . toThrow (
5758 "[Owl] Unhandled error. Destroying the root component"
5859 ) ;
5960 await mountProm ;
@@ -81,11 +82,12 @@ describe("props validation", () => {
8182
8283 const app = new App ( { test : true } ) ;
8384 let error : OwlError | undefined ;
84- const mountProm = app
85- . createRoot ( Parent )
85+ const root = app . createRoot ( Parent ) ;
86+ const errorProm = nextAppError ( app ) ;
87+ const mountProm = root
8688 . mount ( fixture )
8789 . catch ( ( e : Error ) => ( error = e ) ) ;
88- await expect ( nextAppError ( app ) ) . resolves . toThrow (
90+ await expect ( errorProm ) . resolves . toThrow (
8991 "[Owl] Unhandled error. Destroying the root component"
9092 ) ;
9193 await mountProm ;
@@ -135,11 +137,12 @@ describe("props validation", () => {
135137 state = { } ;
136138 let app = new App ( { test : true } ) ;
137139 let error : OwlError | undefined ;
138- let mountProm = app
139- . createRoot ( Parent )
140+ let root = app . createRoot ( Parent ) ;
141+ let errorProm = nextAppError ( app ) ;
142+ let mountProm = root
140143 . mount ( fixture )
141144 . catch ( ( e : Error ) => ( error = e ) ) ;
142- await expect ( nextAppError ( app ) ) . resolves . toThrow (
145+ await expect ( errorProm ) . resolves . toThrow (
143146 "[Owl] Unhandled error. Destroying the root component"
144147 ) ;
145148 await mountProm ;
@@ -155,11 +158,12 @@ describe("props validation", () => {
155158 expect ( error ! ) . toBeUndefined ( ) ;
156159 state = { p : test . ko } ;
157160 app = new App ( { test : true } ) ;
158- mountProm = app
159- . createRoot ( Parent )
161+ root = app . createRoot ( Parent ) ;
162+ errorProm = nextAppError ( app ) ;
163+ mountProm = root
160164 . mount ( fixture )
161165 . catch ( ( e : Error ) => ( error = e ) ) ;
162- await expect ( nextAppError ( app ) ) . resolves . toThrow (
166+ await expect ( errorProm ) . resolves . toThrow (
163167 "[Owl] Unhandled error. Destroying the root component"
164168 ) ;
165169 await mountProm ;
@@ -198,11 +202,12 @@ describe("props validation", () => {
198202 expect ( error ! ) . toBeUndefined ( ) ;
199203 state = { p : 1 } ;
200204 const app = new App ( { test : true } ) ;
201- const mountProm = app
202- . createRoot ( Parent )
205+ const root = app . createRoot ( Parent ) ;
206+ const errorProm = nextAppError ( app ) ;
207+ const mountProm = root
203208 . mount ( fixture )
204209 . catch ( ( e : Error ) => ( error = e ) ) ;
205- await expect ( nextAppError ( app ) ) . resolves . toThrow (
210+ await expect ( errorProm ) . resolves . toThrow (
206211 "[Owl] Unhandled error. Destroying the root component"
207212 ) ;
208213 await mountProm ;
@@ -240,11 +245,12 @@ describe("props validation", () => {
240245 expect ( error ! ) . toBeUndefined ( ) ;
241246 state = { p : 1 } ;
242247 const app = new App ( { test : true } ) ;
243- const mountProm = app
244- . createRoot ( Parent )
248+ const root = app . createRoot ( Parent ) ;
249+ const errorProm = nextAppError ( app ) ;
250+ const mountProm = root
245251 . mount ( fixture )
246252 . catch ( ( e : Error ) => ( error = e ) ) ;
247- await expect ( nextAppError ( app ) ) . resolves . toThrow (
253+ await expect ( errorProm ) . resolves . toThrow (
248254 "[Owl] Unhandled error. Destroying the root component"
249255 ) ;
250256 await mountProm ;
@@ -333,11 +339,12 @@ describe("props validation", () => {
333339 expect ( error ! ) . toBeUndefined ( ) ;
334340 state = { p : [ true , 1 ] } ;
335341 const app = new App ( { test : true } ) ;
336- const mountProm = app
337- . createRoot ( Parent )
342+ const root = app . createRoot ( Parent ) ;
343+ const errorProm = nextAppError ( app ) ;
344+ const mountProm = root
338345 . mount ( fixture )
339346 . catch ( ( e : Error ) => ( error = e ) ) ;
340- await expect ( nextAppError ( app ) ) . resolves . toThrow (
347+ await expect ( errorProm ) . resolves . toThrow (
341348 "[Owl] Unhandled error. Destroying the root component"
342349 ) ;
343350 await mountProm ;
0 commit comments