Skip to content
Source
Sign inSign up

foreground-handoff.test.ts

15 lines500 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { beginForegroundHandoff, isForegroundHandoffActive } from "./foreground-handoff";
4​
5describe("foreground handoff", () => {
6 it("tolerates an end function called twice", () => {
7 const endFirst = beginForegroundHandoff();
8 const endSecond = beginForegroundHandoff();
9 endFirst();
10 endFirst();
11 expect(isForegroundHandoffActive()).toBe(true);
12 endSecond();
13 expect(isForegroundHandoffActive()).toBe(false);
14 });
15});