test: micro-optimize heavy gateway/browser/telegram suites

This commit is contained in:
Peter Steinberger
2026-03-02 22:29:04 +00:00
parent 1fa2488db1
commit 3cb851be90
10 changed files with 242 additions and 143 deletions

View File

@@ -2,7 +2,7 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import type { Chat, Message } from "@grammyjs/types";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import { escapeRegExp, formatEnvelopeTimestamp } from "../../test/helpers/envelope-timestamp.js";
import { withEnvAsync } from "../test-utils/env.js";
import {
@@ -52,10 +52,10 @@ const TELEGRAM_TEST_TIMINGS = {
} as const;
describe("createTelegramBot", () => {
beforeEach(() => {
beforeAll(() => {
process.env.TZ = "UTC";
});
afterEach(() => {
afterAll(() => {
process.env.TZ = ORIGINAL_TZ;
});