@@ -33,9 +33,9 @@ describe('hot module replacement', () => {
33
33
} )
34
34
35
35
test ( 'createRecord' , ( ) => {
36
- expect ( createRecord ( 'test1' ) ) . toBe ( true )
36
+ expect ( createRecord ( 'test1' , { } ) ) . toBe ( true )
37
37
// if id has already been created, should return false
38
- expect ( createRecord ( 'test1' ) ) . toBe ( false )
38
+ expect ( createRecord ( 'test1' , { } ) ) . toBe ( false )
39
39
} )
40
40
41
41
test ( 'rerender' , async ( ) => {
@@ -47,7 +47,7 @@ describe('hot module replacement', () => {
47
47
__hmrId : childId ,
48
48
render : compileToFunction ( `<div><slot/></div>` )
49
49
}
50
- createRecord ( childId )
50
+ createRecord ( childId , Child )
51
51
52
52
const Parent : ComponentOptions = {
53
53
__hmrId : parentId ,
@@ -59,7 +59,7 @@ describe('hot module replacement', () => {
59
59
`<div @click="count++">{{ count }}<Child>{{ count }}</Child></div>`
60
60
)
61
61
}
62
- createRecord ( parentId )
62
+ createRecord ( parentId , Parent )
63
63
64
64
render ( h ( Parent ) , root )
65
65
expect ( serializeInner ( root ) ) . toBe ( `<div>0<div>0</div></div>` )
@@ -125,7 +125,7 @@ describe('hot module replacement', () => {
125
125
unmounted : unmountSpy ,
126
126
render : compileToFunction ( `<div @click="count++">{{ count }}</div>` )
127
127
}
128
- createRecord ( childId )
128
+ createRecord ( childId , Child )
129
129
130
130
const Parent : ComponentOptions = {
131
131
render : ( ) => h ( Child )
@@ -164,7 +164,7 @@ describe('hot module replacement', () => {
164
164
render : compileToFunction ( `<div @click="count++">{{ count }}</div>` )
165
165
}
166
166
}
167
- createRecord ( childId )
167
+ createRecord ( childId , Child )
168
168
169
169
const Parent : ComponentOptions = {
170
170
render : ( ) => h ( Child )
@@ -209,7 +209,7 @@ describe('hot module replacement', () => {
209
209
} ,
210
210
render : compileToFunction ( template )
211
211
}
212
- createRecord ( id )
212
+ createRecord ( id , Comp )
213
213
214
214
render ( h ( Comp ) , root )
215
215
expect ( serializeInner ( root ) ) . toBe (
@@ -246,14 +246,14 @@ describe('hot module replacement', () => {
246
246
} ,
247
247
render : compileToFunction ( `<div>{{ msg }}</div>` )
248
248
}
249
- createRecord ( childId )
249
+ createRecord ( childId , Child )
250
250
251
251
const Parent : ComponentOptions = {
252
252
__hmrId : parentId ,
253
253
components : { Child } ,
254
254
render : compileToFunction ( `<Child msg="foo" />` )
255
255
}
256
- createRecord ( parentId )
256
+ createRecord ( parentId , Parent )
257
257
258
258
render ( h ( Parent ) , root )
259
259
expect ( serializeInner ( root ) ) . toBe ( `<div>foo</div>` )
@@ -272,14 +272,14 @@ describe('hot module replacement', () => {
272
272
__hmrId : childId ,
273
273
render : compileToFunction ( `<div>child</div>` )
274
274
}
275
- createRecord ( childId )
275
+ createRecord ( childId , Child )
276
276
277
277
const Parent : ComponentOptions = {
278
278
__hmrId : parentId ,
279
279
components : { Child } ,
280
280
render : compileToFunction ( `<Child class="test" />` )
281
281
}
282
- createRecord ( parentId )
282
+ createRecord ( parentId , Parent )
283
283
284
284
render ( h ( Parent ) , root )
285
285
expect ( serializeInner ( root ) ) . toBe ( `<div class="test">child</div>` )
@@ -299,7 +299,7 @@ describe('hot module replacement', () => {
299
299
__hmrId : childId ,
300
300
render : compileToFunction ( `<div>child</div>` )
301
301
}
302
- createRecord ( childId )
302
+ createRecord ( childId , Child )
303
303
304
304
const components : ComponentOptions [ ] = [ ]
305
305
@@ -321,7 +321,7 @@ describe('hot module replacement', () => {
321
321
}
322
322
}
323
323
324
- createRecord ( parentId )
324
+ createRecord ( parentId , parentComp )
325
325
}
326
326
327
327
const last = components [ components . length - 1 ]
0 commit comments