There was an error while loading. Please reload this page.
mockChatMessage mocks Foundry’s ChatMessage.create method so that you can test code that uses it.
import { beforeEach, afterEach, describe, expect, it, vi } from 'vitest' import { mockChatMessage } from '@revolutionarygamesco/common-foundryvtt/mocks' import { whisper } from '@revolutionarygamesco/common-foundryvtt' const payload = (create: Mock) => create.mock.calls[0]![0] describe('whisper', () => { it('sends a chat message', async () => { const create = mockChatMessage() await whisper({ content: 'Psst!' }) expect(payload(create).content).toBe('Psst!') }) })