Skip to content

wowlua v0.13.12

Choose a tag to compare

@github-actions github-actions released this 13 Nov 12:33
· 28 commits to main since this release
5ad8a35

0.13.12 (2026-11-13)

New

  • toBeCloseTo works on secret numbers, and the new toBeGreaterThan and toBeLessThan do too: expect(bar:GetStatusBarTexture():GetWidth()).toBeCloseTo(45) measures a bar showing a secret value (its size reads back secret, as in the game). Only how the numbers compare comes out; tests still never read a secret's value.

  • Play in VS Code: the wowlua: UI panel has a Play switch. With it on, the mouse and keyboard go to the game as when you play: the mouse hovers frames (their OnEnter and tooltips), clicks and drags them, and the wheel scrolls them; keys run their key bindings while you hold them (W walks, the arrows turn), and what you type goes into the focused edit box, such as the chat's. Off, a click in the panel is a click, as before.

  • Tagged mobs: UnitIsTapDenied answers true for a mob tagged by a player outside your group, as in the game, so you can test how your nameplates and unit frames grey such mobs. Spawn one tagged with mock.spawnUnit({ ..., tappedByOther = true }) (also in a world profile's units and unit:update), tag it with unit:tap() (or unit:tap(otherPlayer)), and free it with unit:untap(); UNIT_FACTION fires for the mob when its tap becomes denied or free again. The first player to hit an untagged mob (unit:hit, unit:swing, unit:kill({ by = … })) tags it. A mob you or your group tagged, a player and your pet are never tap-denied. Before, UnitIsTapDenied was always false.

  • secret.showWhen(region, shown[, alpha]) in wowlua:secret shows or hides a region by a boolean that may be secret, such as another region's IsShown(). SetShown refuses a secret from addon code; showWhen shows the region and sets its alpha from the secret instead.

Fixed

  • A status bar's fill answers IsShown() and IsVisible() with a secret while the bar shows a secret value, as in the game, and passing that answer to SetShown fails with the game's error, now worded as the game words it when called as a method: "MyAddon/main.lua:12: bad argument #1 to 'SetShown' (Usage: self:SetShown([show]). Secret values are only allowed during untainted execution for this argument.)". Before, the fill answered a plain true, so code that copied it to another region broke in game but passed its tests. Use secret.showWhen to copy it.
  • A status bar showing a secret value, such as another unit's health (bar:SetValue(UnitHealth("target"))), makes the size and place of its fill texture secret, as in the game, and of everything anchored to the fill, however many anchors lie between: the incoming heals bar at the health fill's right edge, a texture set over that bar. Their GetWidth, GetHeight, GetSize, GetRect, GetLeft, GetRight, GetTop, GetBottom, GetCenter and GetPoint answer secret numbers, IsAnchoringSecret() answers true, and comparing such a height (if h > 0) fails with the game's "attempt to compare local 'h' (a secret number value, while execution tainted by 'MyAddon')". The bar itself, and frames anchored to the bar rather than its fill, keep plain sizes. Before, wowlua answered plain numbers there, so code that broke in game at login passed its tests. Read the size from the bar or the frame holding the fill instead, or check with issecretvalue first.
  • Profiles (wowlua test --profile-out), dev builds' error messages and the debugger name each class method at its own line. In a class whose constructor came before fields with a default value further down (clickHooked: boolean = false among the methods), every method above that field was reported at the field's line.
  • Raid target markers work in tests: SetRaidTarget puts the marker on the unit (moving it off any other unit, 0 takes it off), GetRaidTargetIndex answers it and RAID_TARGET_UPDATE fires, so the game's target frame shows the icon. On WoW Forever an addon can no longer mark in combat: as in the game, its SetRaidTarget is refused with ADDON_ACTION_FORBIDDEN ("SetRaidTarget()") and the test fails, also when the addon's changes taint the game's unit menu. The game's own menu, untouched by addons, still marks in combat.
  • The aura buttons of your own aura container (CreateFrame("AuraContainer", nil, parent, "CustomAuraContainerTemplate")) are off limits to your addon in combat, as in the game: while C_Secrets.ShouldAurasBeSecret() is true, any call on a button, such as button:SetSize(…), fails with "calling 'SetSize' on bad self (Attempt to access forbidden object from code tainted by an AddOn …)" (through pcall(button.SetSize, button, …): "bad argument #1 to '?' (…)"), and GetParent() on a frame you put on the button fails the same way. button:IsForbidden() still answers false, as in the game. Out of combat, and in initializeFrame, the button is yours to use. Before, wowlua let addon code use the buttons in combat, so code that broke in game passed its tests. Set up the button itself inside initializeFrame, and keep your own frames on it for changes in combat.
  • Nameplates draw at the game's scale. When NAME_PLATE_UNIT_ADDED fires, the plate's frame (C_NamePlate.GetNamePlateForUnit(unit)) is still at scale 1, as in the game; from the next frame (mock.nextFrame() in a test) it draws at UIParent's scale times the game's nameplate settings: nameplateSelectedScale for your target, nameplateMinScale for a unit farther than nameplateMinScaleDistance (mock.spawnUnit({ distance = 30 })), nameplateMaxScale for a near one. On WoW Forever at a UI scale of 0.64 that is 0.512 far and 0.768 for your target. The plate follows the UI scale, your target, the unit's distance and those settings as they change. Before, wowlua drew plates at scale 1, so lines and sizes laid out for the plate's scale came out at another size than in game.
  • A status bar's fill answers GetWidth, GetHeight and GetSize with the part its value fills, as its edges do. Before, it answered 0 while GetLeft and GetRight gave the filled part.
  • An anchor that would make a loop fails as in the game: when the region you anchor to is itself placed by the one you're anchoring, through any number of anchors (b:SetPoint("TOP", a, "BOTTOM") and then a:SetPoint("TOP", b, "BOTTOM")), SetPoint and SetAllPoints fail with "Action[SetPoint] failed because[Cannot anchor to a region dependent on it]: attempted from: Button:SetPoint.", and the region keeps its points. Before, wowlua anchored it, so code that broke in game passed its tests.