From 5717d12e1fc36f6b584059d20a195af2e86a83c4 Mon Sep 17 00:00:00 2001 From: MapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Mon, 27 Dec 2021 02:34:46 -0600 Subject: [PATCH] add logMessages testing helper --- test/setup-testing.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/setup-testing.ts b/test/setup-testing.ts index 8a445f9..5d23075 100644 --- a/test/setup-testing.ts +++ b/test/setup-testing.ts @@ -1,6 +1,7 @@ import { nextTick } from "node:process" import { promisify } from "node:util" import type { ReactNode } from "react" +import { logPretty } from "../helpers/log-pretty" import { omit } from "../helpers/omit" import { Reacord } from "../library/main" import { TestAdapter, TestCommandInteraction } from "../library/testing" @@ -25,12 +26,17 @@ export function setupReacordTesting() { await assertMessages(expected) } + function logMessages() { + logPretty(sampleMessages(adapter)) + } + return { reacord, adapter, reply, assertMessages, assertRender, + logMessages, } }