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
Jason Godesky edited this page Jul 19, 2026
·
1 revision
mockUser mocks Foundry’s Game.user accessor method so that you can test code that uses it.
Examples
import{beforeEach,afterEach,describe,expect,it,vi}from'vitest'import{mockUser}from'@revolutionarygamesco/common-foundryvtt/mocks'describe('mockUser',()=>{it('mocks the user',async()=>{mockUser()expect(game.user.id).toBeDefined()expect(game.user.name).toBeDefined()})})