You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new warning, W2062: reading more values than a function of yours can give, which are always nil. wowlua counts what each of its returns gives, even when it is declared ...any, and warns on local a, b, c = f() or select(5, f()) past that. It checks your local functions, your module functions, the functions you import from your other files, and the methods of a file-level table (function M:Load()) called as M:Load(), M.Load() or self:Load(), wherever in the file they are defined. A common case is a pcall helper that returns a, b, c, d, e, f, g, h: values 9 and up are lost. To pass every value on, return them through .... It found two such bugs in SuuUI.
Tests: mock.drag(frame, dx, dy, frames) drags over that many frames, so code that follows the mouse in OnUpdate while dragging runs as it would in the game. The mouse now starts on the dragged frame and moves with it (GetCursorPosition).
Tests: anything and ofType("table") from wowlua:test match any value (but nil), or any value of a type, inside toEqual and toHaveBeenCalledWith: expect(onShow).toHaveBeenCalledWith(anything, "TOOLTIP").
Tests: the encounter timeline keeps your addon's timers (C_EncounterTimeline.AddScriptEvent), as WoW Forever does even with its own timeline off: they are listed, readable (GetEventInfo, GetEventState, GetEventTimeRemaining), can be paused, resumed, finished or cancelled, and end when their time runs out, with the timeline's events.
Tests: mock.postLFGListing(createData) lists your character in the group finder, as the game's own listing panel does (the listing arrives a moment later with LFG_LIST_ACTIVE_ENTRY_UPDATE), and mock.delistLFG() takes it down again. Your addon's own C_LFGList.CreateListing is blocked, as in the game.
Tests: put a group member or a pet on a creature's threat list with mob:setThreat(value, member). UnitThreatSituation and UnitDetailedThreatSituation then give each of them their status and percentages as the game does: the one the creature attacks holds it, and someone above them is about to pull. UNIT_THREAT_SITUATION_UPDATE tells each change. Before, only your own threat could be set, always as the holder.
Fixed
Tests: a frame anchored upside down (its top below its bottom, or its right edge left of its left one) has a size of 0, as in the game, instead of a negative size.
Tests: a part stack dropped on a full stack of the same item swaps places with it, as in the game; before, nothing happened.
Tests: an accepted quest is watched only while the "auto quest watch" setting (autoQuestWatch) is on, as in the game, and a watch you remove stays removed.
Tests: C_GuildInfo.GetMOTD() (also named GetGuildRosterMOTD()) from your addon in combat is blocked, as in the game ("Interface action failed because of an AddOn"). Read the message of the day before the fight, or from GUILD_MOTD.
Tests: chat windows keep what Blizzard's chat code or your addon sets (SetChatWindowName, SetChatWindowSize, colour, alpha, shown, locked, docked, saved position and size), and GetChatWindowInfo answers it, as in the game. Before, the setters did nothing.
A function with two parameters of the same name and types (function(_: number, _: string)) no longer fails its runtime check on correct calls: the first _ was checked against the second's value.
wowlua test --coverage no longer reports the closing line of a multi-line return f({ … }) as not run.
GetCursorInfo() gives the cursor's kind ("item", "spell", …) and its details to the checker. It was declared without results, so strict code had to read it through any.
Tests: ClearPoint("TOPLEFT") removes just that point, as in the game. Before, it did nothing, so a Blizzard dropdown menu that opens upward near the bottom of the screen kept both points and came out upside down.
Tests: IsMouseOver measures the mouse against the frame, as in the game: its offsets (IsMouseOver(12, -12, -24, 24)) grow or shrink the area, and a child sticking out of its parent is not over the parent. mock.hover(frame) and mock.click put the mouse on the frame (GetCursorPosition follows), and mock.hover(nil) takes it off every frame. Before, IsMouseOver only asked whether the hovered frame was the frame or one of its children.
Tests: an item put on a part stack of the same item in your bags (C_Container.PickupContainerItem onto it) stacks onto it, as in the game; whatever doesn't fit stays where it was. It used to stay on the cursor, so a bag sort that puts part stacks together failed in tests.
Tests: a frame that holds a secure (protected) frame is protected too, as in the game: IsProtected() gives true, false, showing, hiding or moving it from your addon in combat is blocked, and your secure snippets may resize or move it in combat (Blizzard's spells window among them). It used to count as a plain frame.
Tests: C_SpellBook.PickupSpellBookItem from your addon in combat is blocked ("Interface action failed"), as in the game; out of combat it still picks the spell up. To let players drag spells in combat, pick them up through Blizzard's secure drag template (SecureHandlerDragTemplate with an _ondragstart that returns "spell", spellID).
Tests: anchoring a secure (protected) frame to a texture or a font string fails with the game's error ("Cannot anchor protected frames to regions"), as it does in the game even out of combat. It used to work in tests.
Tests: a frame whose alpha was set from a secret value keeps reading its alpha back as a secret, as in the game, even after you set a plain alpha. Code that reads GetAlpha() again later (a fade from the current alpha) now fails in the test as it does in the game.
wowlua test --coverage with a filter (wowlua test --coverage Units/Threat) no longer fails on the coverage minimums in wowlua.json: they are for the whole suite, and a filtered run's totals still count every file. It used to fail even when all its tests passed.
Tests: a group member logging in or out (member:setOnline(false)) now sends UNIT_CONNECTION, for their target token too, as the game does. Only the roster update came before.
Tests: a spell your character learns from a trainer is known afterwards, as in the game: IsPlayerSpell and C_SpellBook.IsSpellKnown say so. They kept answering as before the training.
Tests: your addon's tooltips show in combat, as in the game. GameTooltip:SetUnit, SetSpellByID, SetItemByID and the other setters gave an empty tooltip in a fight because C_RestrictedActions.CheckAllowProtectedFunctions refused your addon on any frame; it now refuses only on a protected one (a secure button, UIParent).
Tests: an edit box lets go of the keyboard when it is hidden (or a parent of it is), as in the game. It kept the focus, so keys pressed later in the test went into the hidden box instead of opening windows with their key bindings.