Skip to content

Releases: DAndrewBox/GM-Testing-Library

v1.2

05 May 05:30

Choose a tag to compare

GameMaker's Testing Library

Major changes

  • Added simulateAsyncEvent(event_number, data, [inst_id]) - fires any GameMaker async event (HTTP, Save/Load, Dialog, etc.) synchronously during a test with a fake async_load map built from a struct. Allows testing of async event handlers without real network calls or file I/O. Use the new async_load_map macro as a drop-in replacement for async_load in your handlers - it returns the real async_load in normal builds and the simulated map during tests, transparently. Issue #1
  • Added .toThrow([message]) matcher - asserts that a function throws when called, with an optional substring match on the thrown message. Issue #5
  • Added spy(fn) helper and .toHaveBeenCalled(), .toHaveBeenCalledTimes(n), .toHaveBeenCalledWith(args) matchers - wrap any function with spy() to track how many times it was called and with which arguments. Issue #5
  • Nested beforeEach and afterEach hooks now execute correctly across describe scopes. Outer hooks run before inner hooks (outer → inner for beforeEach, inner → outer for afterEach), matching Jest/Vitest behaviour. Issue #11
  • beforeAll and afterAll are now properly scoped per describe block. Each describe level runs its own beforeAll once before its first test and afterAll after all its tests complete. Issue #11

Minor changes

  • Added function-level coverage reporting. Enable with gmtl_show_coverage = true in GMTL_definitions.gml. After all tests finish, a report is printed to the debug console showing which named functions were exercised. Coverage is tracked when a function reference is passed to expect(fn, args). Internal GMTL_ scripts are excluded automatically; user scripts are always scanned.
  • Since the amount of tests increased a lot from previous release, the demo output panel is now scrollable with the mouse wheel and displays a scrollbar on the right edge.
  • Coverage reported output by default on the GameMaker's built-in console

Bug Fixes

  • Fix an issue where mouse positions where not following camera positions after running tests PR #12 by @hazzard993
  • Fix an issue where nested beforeEach hooks were overwriting the parent scope's beforeEach instead of stacking, causing only the innermost hook to execute. Issue #11
  • Fix an issue where beforeAll would never fire when declared inside a describe block. Issue #11

New Contributors


If you have any feature request, issue, comment or suggestion, please let me know in the issues tab!


Full Changelog: v1.1.1...v1.2

gmtl-v1.1.1c

23 Sep 03:18

Choose a tag to compare

GameMaker's Testing Library

Major changes

No major changes introduced in this update

Minor changes

No minor changes introduced in this update

Bug Fixes

  • Fix an issue where inputs that could be simulated were not recognized if gmtl_run_at_start was false. (#10)

If you have any feature request, issue, comment or suggestion, please let me know in the issues tab!


Full Changelog: v1.1.1...v1.1.1c

gmtl-v1.1.1b

30 Aug 04:39
d442d7c

Choose a tag to compare

GameMaker's Testing Library

Major changes

No major changes introduced in this update

Minor changes

  • Improved performance in the keyboard_* functions.
  • Some internal functions logic changed slightly.

Bug Fixes

  • Fix all feather issues introduced in the last version.
  • Fix an issue related to the simulateKeyPress() where as functions io_clear() and keyboard_clear() were not removing the mocked key states.
  • Fix an issue with the "release" state in keyboard virtual keys due to changes in the last version.

If you have any feature request, issue, comment or suggestion, please let me know in the issues tab!


Full Changelog: v1.1.0...v1.1.1

gmtl-v1.1.0

16 Jun 05:22
d88dc8c

Choose a tag to compare

GameMaker's Testing Library

Major changes

  • Added new simulation functions simulateTimesource and simulateCallLater that virtually simulates time_source_* and call_later functions inside tests.
  • Changed internally how simulateKey* and simulateGamepadButton* functions work to support multiple key/button being press at the same time and improve performance outside tests.
  • Added new user manageable variable definitions to set if GMTL should run at game start, and the frames GTML should wait before running in Libraries/GMTL/Setup/GMTL_definitions.
  • Dropped support for GameMaker versions 2023.1.x to 2023.3.x. Only versions 2023.4+ will be supported in the future.

Minor changes

  • Updated Demo draw object to show text colors that match test statuses.
  • Updated Demo tests to implement newer features.
  • Updated documentation/wiki and README to match new changes.
  • Small changes in the way tests are logged in the output windows.
  • Some code for a new "code coverage" feature has been introduced in this release but it's not available to use yet since it contain bugs related to how GameMaker handles sandboxing. This feature should hopefully be released in v1.2.0.

Fixes

  • Issues with library importing GMTL_Definitions file as blank should be solved by now. (#2)
  • Fix documentation issues with toBeEqual() method being called toBe(). (#3)

If you have any feature request, issue, comment or suggestion, please let me know in the issues tab!


Full Changelog: v1.0.0...v1.1.0

gmtl-v1.0.0-beta

19 Jul 17:42

Choose a tag to compare

gmtl-v1.0.0-stable

19 Jul 17:43

Choose a tag to compare

Release v1.0.0-stable