All Projects → Jaliborc → WoWUnit

Jaliborc / WoWUnit

Licence: other
A unit testing framework for World of Warcraft

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to WoWUnit

Bagnon
Single window displays for you items
Stars: ✭ 125 (+525%)
Mutual labels:  addon, world-of-warcraft
pfQuest
A Questhelper and Database Addon for World of Warcraft: Vanilla & TBC
Stars: ✭ 109 (+445%)
Mutual labels:  addon, world-of-warcraft
Pfui
A User Interface Replacement for World of Warcraft: Vanilla & TBC
Stars: ✭ 226 (+1030%)
Mutual labels:  addon, world-of-warcraft
Elvui
ElvUI for World of Warcraft - The Burning Crusade (2.4.3)
Stars: ✭ 89 (+345%)
Mutual labels:  addon, world-of-warcraft
ElvUI
ElvUI for World of Warcraft - Vanilla (1.12.1)
Stars: ✭ 67 (+235%)
Mutual labels:  addon, world-of-warcraft
Tdbattlepetscript
Battle pet combat script for wow.
Stars: ✭ 97 (+385%)
Mutual labels:  addon, world-of-warcraft
Storybook Addon Jest
REPO/PACKAGE MOVED - React storybook addon that show component jest report
Stars: ✭ 177 (+785%)
Mutual labels:  unit-testing, addon
Cursebreaker
TUI/CLI addon updater for World of Warcraft.
Stars: ✭ 597 (+2885%)
Mutual labels:  addon, world-of-warcraft
AIO
AIO is a pure lua server-client communication system for Eluna and WoW.
Stars: ✭ 50 (+150%)
Mutual labels:  addon, world-of-warcraft
Ovale
An add-on for World of Warcraft that displays icons based on scripts
Stars: ✭ 46 (+130%)
Mutual labels:  addon, world-of-warcraft
Yaht
Yet another Hunter Timer for WoW Classic
Stars: ✭ 63 (+215%)
Mutual labels:  addon, world-of-warcraft
Dominos
A main actionbar replacement
Stars: ✭ 72 (+260%)
Mutual labels:  addon, world-of-warcraft
Ajour
A World of Warcraft addon manager written in Rust.
Stars: ✭ 803 (+3915%)
Mutual labels:  addon, world-of-warcraft
Shestakui classic
ShestakUI for WoW Classic (1.13.2)
Stars: ✭ 108 (+440%)
Mutual labels:  addon, world-of-warcraft
Weakauras2
World of Warcraft addon that provides a powerful framework to display customizable graphics on your screen.
Stars: ✭ 731 (+3555%)
Mutual labels:  addon, world-of-warcraft
Elvui
ElvUI for World of Warcraft - Wrath of the Lich King (3.3.5a)
Stars: ✭ 229 (+1045%)
Mutual labels:  addon, world-of-warcraft
Wildpants
Shared services between Bagnon and Combuctor. Pants are a dangerous foe indeed.
Stars: ✭ 19 (-5%)
Mutual labels:  addon, world-of-warcraft
Dungeontools
Fork of Nnoga's Mythic Dungeon Tools addon to restore mob data and improve upon the base code!
Stars: ✭ 329 (+1545%)
Mutual labels:  addon, world-of-warcraft
TellMeWhen
TellMeWhen is a combat tracking AddOn for World of Warcraft Retail and Classic
Stars: ✭ 69 (+245%)
Mutual labels:  addon, world-of-warcraft
AzeriteUI
Custom user interface suite for WoW. Design and code by Lars Norberg and Daniel Troconis.
Stars: ✭ 0 (-100%)
Mutual labels:  addon, world-of-warcraft

Panels

WoWUnit 🔬

Install Patreon

WoWUnit allows you to easily write unit tests for your World of Warcraft addons and provides an interface to monitor them. Unit tests can be run at game events. Also provides methods for temporarily mocking variables.

Example

Let's assume we define the following functions in our addon:

Numbers = function() return 1, 2, 3 end
Realm = function() GetRealmName() .. '!' end

We can make the following tests:

local AreEqual, Exists, Replace = WoWUnit.AreEqual, WoWUnit.Exists, WoWUnit.Replace
local Tests = WoWUnit('MyAddonName', 'PLAYER_UPDATE', 'MONEY_UPDATE')
    -- tests will be called at startup, PLAYER_UPDATE and MONEY_UPDATE events

function Tests:PassingTest()
    AreEqual({1,2,3}, {Numbers()})
    Exists(true)
end

function Tests:FaillingTest()
    AreEqual('Apple', 'Pie')
    Exists(false)
end

function Tests:MockingTest()
    Replace('GetRealmName', function() return 'Horseshoe' end)
    AreEqual('Horseshoe!', Realm())
end

Test API

A unit test group is created by calling WoWUnit(name, event1, event2, ...) or WoWUnit:NewGroup(name, event1, event2, ...). Unit tests in the group are called at startup and whenever the game events listed occur.

A unit test is defined by indexing a function in the group. While the test is running, the following methods can be used:

Name Description
AreEqual(a, b) Checks wether a and b match. Throws a fail status if not.
IsTrue(value) Checks wether value passes an if statement. Throws a fail status if not.
Exists(value) Same as above.
IsFalse(value) Checks wether value fails an if statement. Throws a fail status if not.
Replace([table,] name, replace) Temporarly replaces table[name] or global name with replace while the unit test is running.
ClearReplaces() Resets all replacements done so far.
Enable() Enables the current unit test (enabled by default).
Disable() Disables the current unit test.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].