Skip to content

mockActors

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

mockActors is a mock for a Collection of actors (like game.actors). 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 { mockActors, mockActor } from '@revolutionarygamesco/common-foundryvtt/mocks'

const actor = mockActor({ name: 'John Doe' })
const dict: Record<string, foundry.documents.Actor> = {}
dict[getID(actor.uuid)] = actor
mockActors(dict)

Clone this wiki locally