Ulenar Of Mondarth
Ulenar Of Mondarth
LOELeague of Extraordinary FoundryVTT Developers
Created by Ulenar Of Mondarth on 9/15/2024 in #package-development
Development setup for testing?
Starting my Foundry development journey and documenting it as I go along. I'm setting up my development environment. Started by reviewing contents of the foundryvtt.wiki Development notes, the various pages from foundryvtt.com on package development, scanning this Discord server, and the https://foundryvttt-hub.com site. I've found a few blog posts on module development and have been reviewing code repositories for various modules. I have, so far, seen no automated testing (the Quench module implies that someone has some testing but I have yet to see any in the wild---and the irony that the quench module itself contains no test is not lost on me). So, does anyone use automated tests? If so, what and how? I guess I want to check that I'm not missing something obvious and in danger of 'reinventing the wheel' before I go too far down this path. Current thinking For integration/end-end testing I currently my plan is to use docker to run up test instances of FoundryVTT. The 'module under test' being mounted into the modules directory and a modeJS script to use Setup.installPackage to recursively install dependent packages and game system (with options to specify additional installs). Create test world etc. either through code, snapshot, or using UI driver (Playwright). Then run integration/end-to-end test suits (mocha for integration, Playwright for end-to-end). Unit testing is simpler as it does not require Foundry or dependencies. This configuration should allow automated testing (especially for CI) and, importantly, allow me to easily test the impact when dependencies update.
12 replies