mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REM] utils: remove memoize, parseXML function
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
escape,
|
||||
memoize,
|
||||
debounce,
|
||||
patch,
|
||||
unpatch
|
||||
@@ -18,26 +17,6 @@ describe("escape", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("memoize", () => {
|
||||
test("return correct value", () => {
|
||||
const f = memoize((a, b) => a + b);
|
||||
expect(f(1, 3)).toBe(4);
|
||||
});
|
||||
|
||||
test("does not recompute if not needed", () => {
|
||||
let nCalls = 0;
|
||||
function origFunction(a: number, b: number): number {
|
||||
nCalls++;
|
||||
return a + b;
|
||||
}
|
||||
const memoized = memoize(origFunction);
|
||||
|
||||
expect(memoized(1, 3)).toBe(4);
|
||||
expect(memoized(1, 3)).toBe(4);
|
||||
expect(nCalls).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("debounce", () => {
|
||||
test("works as expected", () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
Reference in New Issue
Block a user