// example.jsx import { h, Fragment, render, mount, ref, nextTick } from '@/index'; const testChangeRef = ref void)>(null); const Component = mount((renew, _props) => { let count1 = 0; let count2 = 0; let count3 = 0; let count4 = 0; const el = ref(null); const change = () => { count1 += 1; count2 += 2; count3 += 3; count4 -= 1; renew(); }; testChangeRef.value = change; return () => (
  • count1: {count1}
  • count2: {count2}
  • count3: {count3}
  • count4: {count4}
  • ); }); const testWrap = document.getElementById('root') || document.createElement('div'); const destroy = render(
    div
    , testWrap); destroy(); if (import.meta.vitest) { const { it, expect } = import.meta.vitest; it('Is renew working properly?', () => { const destroy = render(, testWrap); expect(testWrap.outerHTML).toBe( '
  • count1: 0
  • count2: 0
  • count3: 0
  • count4: 0
  • ' ); destroy(); nextTick().then(() => { expect(testWrap.outerHTML).toBe('
    '); }); }); }