DirkScripts Logo

Login With FiveM

Login

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:

  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 })

Copyright Β© 2026 DirkScripts.

Not affiliated with or endorsed by Rockstar North, Take-Two Interactive, or any other rights holders. FiveM is a copyright and registered trademark of Take-Two Interactive Software, Inc.
Our checkout system is provided by Tebex Limited, who manage payment processing, product delivery, and billing support. Prices shown in currencies other than GBP are approximate conversions updated daily. All purchases are processed in GBP, so the final amount charged may vary depending on your bank or payment provider’s exchange rate.