This emulates the basic ccTweaked functions missing in basic-lua.
- fs
- http
- vector-functions
- settings
- (no validations what so ever as of yet)
Additionally it emulates our scm script and includes the json handler - which makes tests a lot easier.
As this repo emulates many functionalites given by ccTweaked, you might want to test you code outside of Minecraft, maybe even automated. To achieve that, you need to download the scripts listed above and save them in your testingenv.
Ideally you want to add those scripts to your .gitignore and only add them locally / for github actions.
-- IN YOUR TEST_SPEC:
package.path = "pathToTestSuite-lib_Folder/?.lua;" .. package.path
-- adds all libs to your path, so they are available without specifying their path each time
_G.fs = require("fs")
_G.vector = require("vector")
-- ...
-- _G holds all global variables, so it may be used by your other scripts
local scriptToTest = require("scriptToTest")
-- this script can now access the fs- & vector-functions
-- without any need to modify the script you want to test
For how to import the scipts, an example is already used by this repo for some of ITS dependancies (which you will also need):