DirkScripts
Testing
dirk_fishing ships a built-in test suite powered by lib.test. It validates the inventory bridge (so it doubles as a compatibility check for any inventory) plus fishing-specific logic β XP / level progression and earnings tracking.
βΉοΈ Console-only β a connected player can never trigger it, whatever their permissions. Only the server console can.
#Running it
From the server console:
dirktest -- run everything
dirktest inventory -- only the inventory-bridge tests
dirktest fishing 2 -- fishing-specific tests against player id 2
Arguments are [nameFilter] [playerId] [+c] in any order (the player id targets a connected player; it defaults to the first online).
β οΈ The tests briefly mutate the target player's inventory / XP / stats and restore afterwards β run them on a test server, not a live one.
#Checking a new inventory works
The inventory tests are bridge-agnostic (ox / qb / qs / devix / bp / β¦), so this is the quickest way to confirm a new inventory is compatible with dirk_fishing:
- Point dirk_lib at it β
/dirk_configβ Bridging, or just let autodetect pick it up. - Run
dirktest inventoryfrom the server console. - All green = add / remove / metadata / canCarry / usable-items all work through that inventory.
#Adding your own tests
Tests live in the resource's tests/ folder. Add one with lib.test.add β full API in the lib.test documentation:
lualib.test.add('fishing: something works', function(t) t.expect(GetFishingXp(t.player)).toBeType('number') end, { requiresPlayer = true })
