Saltar al contenido principal

Interface: FakeMoodleState

Defined in: testing/fakeMoodle.ts:62

What the fake Moodle serves (serveFakeMoodle): the test sets it up and may change it while it runs (log someone in, change the sesskey); the fake records what it served in it.

Properties​

PropertyTypeDescriptionDefined in
bodies?Record<string, string>Extra body HTML for the pages at these paths (logged in only).testing/fakeMoodle.ts:70
bodyClasses?Record<string, string>Extra body classes for the pages at these paths, as Moodle adds (format-topics on a course page).testing/fakeMoodle.ts:72
pagesServed?string[]Every page path served, for tests that count page loads.testing/fakeMoodle.ts:74
serviceCalls?object[]Every service call received.testing/fakeMoodle.ts:76
services?Record<string, (args) => unknown>AJAX services by name: what each returns as data for its arguments; throwing ServiceFailure answers with that error code.testing/fakeMoodle.ts:68
sesskey?stringThe session's sesskey: changing it makes older tabs' service calls fail with invalidsesskey.testing/fakeMoodle.ts:66
user?objectThe logged-in user; none means every page is the login page.testing/fakeMoodle.ts:64
user.fullNamestring-testing/fakeMoodle.ts:64
user.idnumber-testing/fakeMoodle.ts:64