You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A record of Foundry Documents by UUID that you would like the mock to provide.
Examples
import{beforeEach,afterEach,describe,expect,it,vi}from'vitest'import{mockFromUuid}from'@revolutionarygamesco/common-foundryvtt/mocks'import{getActorName}from'./get-actor-name.ts'describe('getActorName',()=>{beforeEach(()=>{mockFromUuid({'Actor.1111111111111111': {name: 'John Doe'}asfoundry.documents.Actor})})afterEach(()=>{vi.unstubAllGlobals()})it('resolves the document and returns its name',async()=>{expect(awaitgetActorName('Actor.1111111111111111')).toBe('John Doe')})it('returns null when the UUID resolves to nothing',async()=>{expect(awaitgetActorName('Actor.2222222222222222')).toBeNull()})})