Skip to content

mockJournal

Jason Godesky edited this page Aug 15, 2026 · 1 revision

mockJournal is a mock for a Collection of journal entries (like game.journal). The mock is rather bare, really only covering get.

Examples

import { beforeEach, afterEach, describe, expect, it, vi } from 'vitest'
import { getID } from '@revolutionarygamesco/common-foundryvtt'
import { mockJournal, mockJournalEntry } from '@revolutionarygamesco/common-foundryvtt/mocks'

const entry = mockJournal({ name: 'Test' })
const dict: Record<string, foundry.documents.JournalEntry> = {}
dict[getID(entry.uuid)] = item
mockJournal(dict)

Clone this wiki locally