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 27, 2026
·
2 revisions
mockFolders creates a set of mock folders for you to test methods that interact with folders on.
Parameters
paths: string[]
Each path designates a folder to create, including its preceding hierarchy. So, for example, Root Folder/Subfolder/Test Folder will create a Root Folder, with a Subfolder inside of it, and a Test Folder inside of that.
Examples
import{describe,it,expect}from'vitest'import{mockFolders}from'@revolutionarygamesco/common-foundryvtt/mocks'import{findFolder}from'./find-folder.ts'describe('findFolder',()=>{it('finds a folder by its full path',()=>{const{ folders }=mockFolders(['Root Folder/Subfolder/Test Folder'])expect(findFolder('Root Folder/Subfolder/Test Folder')).toBe(folders.get('Root Folder/Subfolder/Test Folder'))})})