Skip to content

test: let the mock hold the installed modules - #12

Merged
fcsouza merged 1 commit into
mainfrom
test/seeded-modules
Sep 14, 2026
Merged

fcsouza merged 1 commit into
mainfrom
test/seeded-modules

Conversation

@fcsouza

@fcsouza fcsouza commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

The update-check test built game.modules by hand — a Map wrapped in get, has, values and size — because the mock's collection answered get and has and the checker walks the list.

@vttforge/testing 0.14.0 takes the modules as an option, so that helper is gone:

mock = withMockFoundry({ user: { isGM: options.isGM ?? true }, modules: handles });

One thing worth naming for the next person: Handle had to become a type rather than an interface. MockModuleOptions carries an index signature and an interface does not satisfy one, so the call failed to compile until it changed. The error message says it, but it reads like a puzzle the first time.

Same handles, same 40 tests. pnpm run typecheck and pnpm run lint are clean.

The update-check test built `game.modules` by hand, because the mock's answered
`get` and `has` and the checker walks the list. `@vttforge/testing` 0.14.0 takes
the modules as an option, so the hand-built collection is gone and the handles
are passed straight in.

`Handle` became a type rather than an interface. `MockModuleOptions` carries an
index signature, and an interface does not satisfy one.

Same handles, same 40 tests.
@fcsouza
fcsouza merged commit 76dfe6b into main Sep 14, 2026
1 check passed
@fcsouza
fcsouza deleted the test/seeded-modules branch September 14, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant