Skip to content

Commit 51510ad

Browse files
committed
test: fix hmr test
1 parent 6abac87 commit 51510ad

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/runtime-core/__tests__/hmr.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ describe('hot module replacement', () => {
3333
})
3434

3535
test('createRecord', () => {
36-
expect(createRecord('test1', {})).toBe(true)
36+
expect(createRecord('test1')).toBe(true)
3737
// if id has already been created, should return false
38-
expect(createRecord('test1', {})).toBe(false)
38+
expect(createRecord('test1')).toBe(false)
3939
})
4040

4141
test('rerender', async () => {
@@ -47,7 +47,7 @@ describe('hot module replacement', () => {
4747
__hmrId: childId,
4848
render: compileToFunction(`<div><slot/></div>`)
4949
}
50-
createRecord(childId, Child)
50+
createRecord(childId)
5151

5252
const Parent: ComponentOptions = {
5353
__hmrId: parentId,
@@ -59,7 +59,7 @@ describe('hot module replacement', () => {
5959
`<div @click="count++">{{ count }}<Child>{{ count }}</Child></div>`
6060
)
6161
}
62-
createRecord(parentId, Parent)
62+
createRecord(parentId)
6363

6464
render(h(Parent), root)
6565
expect(serializeInner(root)).toBe(`<div>0<div>0</div></div>`)
@@ -125,7 +125,7 @@ describe('hot module replacement', () => {
125125
unmounted: unmountSpy,
126126
render: compileToFunction(`<div @click="count++">{{ count }}</div>`)
127127
}
128-
createRecord(childId, Child)
128+
createRecord(childId)
129129

130130
const Parent: ComponentOptions = {
131131
render: () => h(Child)
@@ -166,7 +166,7 @@ describe('hot module replacement', () => {
166166
},
167167
render: compileToFunction(template)
168168
}
169-
createRecord(id, Comp)
169+
createRecord(id)
170170

171171
render(h(Comp), root)
172172
expect(serializeInner(root)).toBe(
@@ -203,14 +203,14 @@ describe('hot module replacement', () => {
203203
},
204204
render: compileToFunction(`<div>{{ msg }}</div>`)
205205
}
206-
createRecord(childId, Child)
206+
createRecord(childId)
207207

208208
const Parent: ComponentOptions = {
209209
__hmrId: parentId,
210210
components: { Child },
211211
render: compileToFunction(`<Child msg="foo" />`)
212212
}
213-
createRecord(parentId, Parent)
213+
createRecord(parentId)
214214

215215
render(h(Parent), root)
216216
expect(serializeInner(root)).toBe(`<div>foo</div>`)
@@ -229,14 +229,14 @@ describe('hot module replacement', () => {
229229
__hmrId: childId,
230230
render: compileToFunction(`<div>child</div>`)
231231
}
232-
createRecord(childId, Child)
232+
createRecord(childId)
233233

234234
const Parent: ComponentOptions = {
235235
__hmrId: parentId,
236236
components: { Child },
237237
render: compileToFunction(`<Child class="test" />`)
238238
}
239-
createRecord(parentId, Parent)
239+
createRecord(parentId)
240240

241241
render(h(Parent), root)
242242
expect(serializeInner(root)).toBe(`<div class="test">child</div>`)
@@ -256,7 +256,7 @@ describe('hot module replacement', () => {
256256
__hmrId: childId,
257257
render: compileToFunction(`<div>child</div>`)
258258
}
259-
createRecord(childId, Child)
259+
createRecord(childId)
260260

261261
const components: ComponentOptions[] = []
262262

@@ -278,7 +278,7 @@ describe('hot module replacement', () => {
278278
}
279279
}
280280

281-
createRecord(parentId, parentComp)
281+
createRecord(parentId)
282282
}
283283

284284
const last = components[components.length - 1]

0 commit comments

Comments
 (0)