Skip to content

mockModules

Jason Godesky edited this page Jul 28, 2026 · 1 revision

mockModules allows you to mock the presence of particular modules in your tests.

Parameters

installed: string[]

An array of the names of the modules you want to convince your test are really there.

Examples

import { describe, expect, it, vi } from 'vitest'
import { mockModules } from '@revolutionarygamesco/common-foundryvtt/mocks'
import { checkModules } from './check-module.ts'

describe('checkModules', () => {
  it('returns true if the module is present', () => {
    mockModules)['necessary-module'])
    expect(checkModules()).toBe(true)
  })
})

Clone this wiki locally