/
mustreets
/
CreateTransactions
Обзор
Документация
Войти
/
mustreets
/
CreateTransactions
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
test/wallet/Reporting.test.ts
19 строк
663 B
Slava
Initialize project with essential configurations and structures
14 май 2026, 22:23
14 май 2026, 22:23
a89cd26
Код
Авторство
О чём код?
import { describe, expect, it, vi } from "vitest"; import { AppMode, Reporter } from "../../libJS/services/Reporting"; describe("Reporter", () => { it("routes track to onTrack in production mode", () => { const onTrack = vi.fn(); const reporter = new Reporter({ mode: AppMode.PROD, onTrack }); reporter.track("evt", { a: 1 }); expect(onTrack).toHaveBeenCalledWith("evt", { a: 1 }); }); it("routes log to onLog in production mode", () => { const onLog = vi.fn(); const reporter = new Reporter({ mode: AppMode.PROD, onLog }); reporter.log("hello", { x: 2 }); expect(onLog).toHaveBeenCalledWith("hello", { x: 2 }); }); });