]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: update edison/fix/vaporHMR 13866/head
authordaiwei <daiwei521@126.com>
Fri, 12 Sep 2025 13:04:21 +0000 (21:04 +0800)
committerdaiwei <daiwei521@126.com>
Fri, 12 Sep 2025 14:28:33 +0000 (22:28 +0800)
packages/runtime-vapor/__tests__/hmr.spec.ts

index 946cf8de4e2fce85fc313980d4f3311d2016f8dd..21ca611263ea108afab4cc2bdde6091485ea56bc 100644 (file)
@@ -76,6 +76,25 @@ describe('hot module replacement', () => {
       `"<div>child changed</div><div>root</div>"`,
     )
 
+    // reload child again
+    reload(childId, {
+      __hmrId: childId,
+      __vapor: true,
+      setup() {
+        const msg = ref('child changed2')
+        return { msg }
+      },
+      render(ctx: any) {
+        const n0 = template(`<div> </div>`)()
+        const x0 = child(n0 as any)
+        renderEffect(() => setText(x0 as any, ctx.msg))
+        return [n0]
+      },
+    })
+    expect(root.innerHTML).toMatchInlineSnapshot(
+      `"<div>child changed2</div><div>root</div>"`,
+    )
+
     // reload parent
     reload(parentId, {
       __hmrId: parentId,
@@ -93,7 +112,7 @@ describe('hot module replacement', () => {
       },
     })
     expect(root.innerHTML).toMatchInlineSnapshot(
-      `"<div>child changed</div><div>root changed</div>"`,
+      `"<div>child changed2</div><div>root changed</div>"`,
     )
   })
 })