Download
(11 Kb)
Download
Updated: 03/03/23 07:10 AM
Compatibility:
Scribes of Fate (8.3.5)
Firesong (8.2.5)
Updated:03/03/23 07:10 AM
Created:03/03/23 07:10 AM
Monthly downloads:24
Total downloads:894
Favorites:1
MD5:
Taneth - Testing Framwork
Version: 1.0.0
by: sirinsidiator [More]
Taneth is a test framework for Elder Scrolls Online addons, inspired by Mocha and busted.
It can be used both inside the game and outside with the help of ESOLua.

Test suites follow the same structure as Mocha and busted, with the exception that they have to be wrapped into a call to Taneth. A simple test file could look like this:
Lua Code:
  1. if not Taneth then return end
  2. Taneth("MySuite", function()
  3.     describe("some group", function()
  4.         it("some test", function()
  5.             assert.fail("I'm a bad test.")
  6.         end)
  7.     end)
  8. end)

Outside the game you can use Taneth.bat as long as esolua.exe is on your system's path.
Pass "--help" to it for more information on how to use the command.

Running the test above will show output like this:
Code:
MySuite / some group / some test
test.lua:10: I'm a bad test.

Results for suite 'MySuite':
-
0 successes / 1 failures / 0 errors : 0.00 seconds
To run tests inside the game you can use the "/taneth" slash command.
Per default it will simply run all available test suites, but you can pass it the id ("MySuite" in the example above) to limit it to a specific test suite.

When a test behaves differently outside the game than it does inside, please make sure to report it either here or on the ESOLua project if it's due to Lua itself. The ultimate goal is to have it mimic the game as closely as possible.

The project is currently in a very early stage and many features are not yet implemented.
If you have any particular requests, feel free to open an issue on github.
Post A Reply Comment Options
Unread 03/03/23, 10:51 AM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1578
File comments: 1129
Uploads: 41
Re: Awesome

Originally Posted by FlatBadger
Bah - now I have no excuse not to write tests for my addons

One quick question - there's a lot of information printed to the debug window when running tests in game, what is this?


Ah - forget it - I've just seen useful debug info for a failed test - doh
Hehe. Don't feel pressured though. It's ok to not write tests if you don't want to.

The data you see is simply the whole error message from the game, including the stack trace.
You can use my DebugLogViewer to view the output in a more digestible way.
Report comment to moderator  
Reply With Quote
Unread 03/03/23, 09:32 AM  
FlatBadger
 
FlatBadger's Avatar
AddOn Author - Click to view AddOns

Forum posts: 17
File comments: 358
Uploads: 5
Awesome

Bah - now I have no excuse not to write tests for my addons

One quick question - there's a lot of information printed to the debug window when running tests in game, what is this?


Ah - forget it - I've just seen useful debug info for a failed test - doh
Last edited by FlatBadger : 03/03/23 at 10:00 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.