[REM] utils: remove memoize, parseXML function

This commit is contained in:
Géry Debongnie
2019-05-10 20:46:21 +02:00
parent 53911de00a
commit dfa7d5932d
3 changed files with 10 additions and 52 deletions
-21
View File
@@ -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();