PDA

View Full Version : FG Test - Automated Tests for Extensions and Rulesets



Vam
February 21st, 2021, 21:53
This extension is for extension and ruleset developers. It enables TDD (Test Driven Development) and BDD (Behaviour Driven Development).

A longer description and brief tutorial can be found on the github page here: https://github.com/zymsys/fg-test

This 0.2 release adds a FG compatible promises library. It makes writing tests for async functions reasonably easy.

I'm still fairly new to Lua and extension coding, so I'd appreciate any feedback, good or bad.

Vam
February 27th, 2021, 18:52
I just released version 0.2. This version includes a promises library that can be used to simplify async code. Some examples and an explanation are provided on the github page.

I'd appreciate hearing from you if you've tried to use this, even if it didn't go well. My next step will be to use it in my work on ChatBat, and I expect I'll find some things to improve / fix while I'm using it.

houseofdexter
March 26th, 2021, 00:51
I plan on getting into writing fg extensions...and I'll use your extension. I'm also new to Lua...but have over 25+ years of programming exp. and look forward to being able to write unit-tests for my code.

Vam
March 26th, 2021, 13:05
Great, let me know how it goes. I found a bug last weekend and just pushed the fix for it to github for you now. Let me know if you find any other issues. I'm working on some library routines for the behavioural tests that I think will have a lot of use outside of fg-test, starting with a character builder.

Corun
April 7th, 2021, 19:39
It's great to have access to some tests when working with FG :D

One request from me would be to have way to specify functions that are executed:
On setup of Test Suite.
Before Each Test.
After Each Test.
After Test Suite is finished.

Why? I am working on extension that adds/changes/removes some data to DB and way to automatically do set up and cleanup would be very helpful.

Vam
April 7th, 2021, 20:00
Yes, great idea. All of the more mature test harnesses have this and it shouldn't be too hard to add. I've had very little free time to work on this, but I'll put that on the to do list. I'm also open to PRs! ;)