Testing

Fishing Sim V2
Updated a month ago · v2.1.8

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.

i

Console-only — a connected player can never trigger it, whatever their permissions. Only the server console can.

Running it

From the server console:

code
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:

  1. Point dirk_lib at it — /dirk_config → Bridging, or just let autodetect pick it up.
  2. Run dirktest inventory from the server console.
  3. 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:

lua
lib.test.add('fishing: something works', function(t)
  t.expect(GetFishingXp(t.player)).toBeType('number')
end, { requiresPlayer = true })
Was this page helpful?
This page was last updated on 7 August 2026
DIRKSCRIPTS
All you need for your FiveM server.10% off your first order

Unsubscribe any time.

Copyright © 2026 DirkScripts. Not affiliated with or endorsed by Rockstar North or Take-Two Interactive.