


























@@ -35,6 +35,14 @@ async function createFixture() {
3535return { storePath, sessionKey, sessionStore, entry, transcriptPath };
3636}
373738+function firstSessionEndCall() {
39+return hookRunnerMocks.runSessionEnd.mock.calls[0] ?? [];
40+}
41+42+function firstSessionStartCall() {
43+return hookRunnerMocks.runSessionStart.mock.calls[0] ?? [];
44+}
45+3846describe("session-updates lifecycle hooks", () => {
3947beforeEach(async () => {
4048vi.resetModules();
@@ -80,8 +88,8 @@ describe("session-updates lifecycle hooks", () => {
8088expect(hookRunnerMocks.runSessionEnd).toHaveBeenCalledTimes(1);
8189expect(hookRunnerMocks.runSessionStart).toHaveBeenCalledTimes(1);
829083-const [endEvent, endContext] = hookRunnerMocks.runSessionEnd.mock.calls.at(0) ?? [];
84-const [startEvent, startContext] = hookRunnerMocks.runSessionStart.mock.calls.at(0) ?? [];
91+const [endEvent, endContext] = firstSessionEndCall();
92+const [startEvent, startContext] = firstSessionStartCall();
85938694expect(endEvent?.sessionId).toBe("s1");
8795expect(endEvent?.sessionKey).toBe(sessionKey);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。