rootLogoutTelemetryBoundary.test.ts 653 B

123456789101112131415161718
  1. import { readFileSync } from "node:fs";
  2. import { describe, expect, it } from "vitest";
  3. describe("logout telemetry boundary", () => {
  4. it("does not await auxiliary telemetry before the logout business flow", () => {
  5. const source = readFileSync(
  6. new URL("../src/root/useRootWorkspaceActions.ts", import.meta.url),
  7. "utf8",
  8. );
  9. const logoutFlow = source.match(
  10. /const handleLogout[\s\S]*?services\.oauthService\.logout\(\)/u,
  11. )?.[0];
  12. expect(logoutFlow).toBeDefined();
  13. expect(logoutFlow).toMatch(/void reportAppTelemetryEvent\(/u);
  14. expect(logoutFlow).not.toMatch(/await reportAppTelemetryEvent\(/u);
  15. });
  16. });