UNPKG

siegel

Version:

Web application development ecosystem

1 lines 410 B
import e from"../get_uniq_id/index.js";import t,{clearState as o}from"./index.js";describe("common/memo",()=>{let i=e(),m=0,s=()=>++m;test("memoize",()=>{expect(t(s,"dep string",i)).toBe(1)}),test("use memoized",()=>{expect(t(s,"dep string",i)).toBe(1)}),test("perform new calculation",()=>{expect(t(s,"new dep string",i)).toBe(2)}),test("clear state",()=>{o(i),m=0,expect(t(s,"new dep string",i)).toBe(1)})});