I’ve found some techniques for running automated unit tests against lua code but one of the main things I can’t think of is how you unit test FiveM resources due to the natives being directly hooked into the core game. If I was writing a .NET resource I can create a “service class” with a proxy method to wrap natives and inject that in to where I woud call through to natives. Calling this proxy method from my resource code instead which would then allow mocking the service class and then providing the ability to create a full unit test suite. The biggest problem I’ve seen with FiveM frameworks is the lack of ability to run existing test suites after making changes and seeing if anything breaks without the need to spin up the server and connect. Testing is so slow and error prone and being able to use industry standard techniques to ensure code quality would be amazing.
Does anyone know of a way to achieve this in LUA?