From 51510adacb5374dbeaf8e8d67307f36755ade4a4 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 12 Jun 2020 17:17:01 -0400 Subject: [PATCH] test: fix hmr test --- packages/runtime-core/__tests__/hmr.spec.ts | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/runtime-core/__tests__/hmr.spec.ts b/packages/runtime-core/__tests__/hmr.spec.ts index da4bbc39..a53c7a3e 100644 --- a/packages/runtime-core/__tests__/hmr.spec.ts +++ b/packages/runtime-core/__tests__/hmr.spec.ts @@ -33,9 +33,9 @@ describe('hot module replacement', () => { }) test('createRecord', () => { - expect(createRecord('test1', {})).toBe(true) + expect(createRecord('test1')).toBe(true) // if id has already been created, should return false - expect(createRecord('test1', {})).toBe(false) + expect(createRecord('test1')).toBe(false) }) test('rerender', async () => { @@ -47,7 +47,7 @@ describe('hot module replacement', () => { __hmrId: childId, render: compileToFunction(`
`) } - createRecord(childId, Child) + createRecord(childId) const Parent: ComponentOptions = { __hmrId: parentId, @@ -59,7 +59,7 @@ describe('hot module replacement', () => { `
{{ count }}{{ count }}
` ) } - createRecord(parentId, Parent) + createRecord(parentId) render(h(Parent), root) expect(serializeInner(root)).toBe(`
0
0
`) @@ -125,7 +125,7 @@ describe('hot module replacement', () => { unmounted: unmountSpy, render: compileToFunction(`
{{ count }}
`) } - createRecord(childId, Child) + createRecord(childId) const Parent: ComponentOptions = { render: () => h(Child) @@ -166,7 +166,7 @@ describe('hot module replacement', () => { }, render: compileToFunction(template) } - createRecord(id, Comp) + createRecord(id) render(h(Comp), root) expect(serializeInner(root)).toBe( @@ -203,14 +203,14 @@ describe('hot module replacement', () => { }, render: compileToFunction(`
{{ msg }}
`) } - createRecord(childId, Child) + createRecord(childId) const Parent: ComponentOptions = { __hmrId: parentId, components: { Child }, render: compileToFunction(``) } - createRecord(parentId, Parent) + createRecord(parentId) render(h(Parent), root) expect(serializeInner(root)).toBe(`
foo
`) @@ -229,14 +229,14 @@ describe('hot module replacement', () => { __hmrId: childId, render: compileToFunction(`
child
`) } - createRecord(childId, Child) + createRecord(childId) const Parent: ComponentOptions = { __hmrId: parentId, components: { Child }, render: compileToFunction(``) } - createRecord(parentId, Parent) + createRecord(parentId) render(h(Parent), root) expect(serializeInner(root)).toBe(`
child
`) @@ -256,7 +256,7 @@ describe('hot module replacement', () => { __hmrId: childId, render: compileToFunction(`
child
`) } - createRecord(childId, Child) + createRecord(childId) const components: ComponentOptions[] = [] @@ -278,7 +278,7 @@ describe('hot module replacement', () => { } } - createRecord(parentId, parentComp) + createRecord(parentId) } const last = components[components.length - 1]