mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 08:40:52 +08:00
Playwright is more flexible and has better developer experience than Cypress.
We add end to end tests covering:
- project source browsing
- tree view
- commit list view
- commit view
- routing
- hash based
- history API based
- clipboard copy paste functionality
- seed view
- project search
- landing page view
- settings
Co-authored-by: Sebastian Martinez <me@sebastinez.dev>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
14 lines
444 B
TypeScript
14 lines
444 B
TypeScript
import { cached } from "@app/cache";
|
|
import { expect, test, vi } from "vitest";
|
|
|
|
test("it caches undefined return values", async () => {
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
const inner = vi.fn(async (_: string) => undefined);
|
|
const memoized = cached(inner, key => key);
|
|
|
|
expect(await memoized("a")).toBe(undefined);
|
|
expect(await memoized("a")).toBe(undefined);
|
|
|
|
expect(inner).toHaveBeenCalledTimes(1);
|
|
});
|