-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.lua
More file actions
78 lines (66 loc) · 2.19 KB
/
Copy pathinit.lua
File metadata and controls
78 lines (66 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
--[[
LuaGround - QBCore Testing Framework
====================================
Test your QBCore scripts without spinning up a FiveM server.
Full QBCore framework mocks, 2,000+ FiveM natives, zero dependencies.
Usage:
dofile('init.lua') -- Load the framework
dofile('tests/test_helper.lua') -- Load test utilities
Created by viscosity on behalf of the Black Mesa RP Community
License: MIT
]]
print('========================================')
print(' L U A G R O U N D')
print(' QBCore Testing - No Server Required')
print('========================================')
-- Initialize mock return value storage
MockReturnValue = MockReturnValue or {}
-- Get the directory of this file
local function getScriptPath()
local str = debug.getinfo(2, 'S').source:sub(2)
return str:match('(.*[/\\])') or './'
end
local basePath = getScriptPath()
-- Helper to load files relative to this script
local function loadFile(path)
local fullPath = basePath .. path
local file = io.open(fullPath, 'r')
if file then
file:close()
dofile(fullPath)
return true
else
print('[WARN] Could not load: ' .. fullPath)
return false
end
end
-- Load core FiveM mocks
print('\n[Loading FiveM Core Mocks]')
loadFile('fivem/globals.lua')
loadFile('fivem/events.lua')
-- Load native mocks
print('\n[Loading Native Mocks]')
loadFile('client/natives.lua')
loadFile('client/cfx.lua')
loadFile('server/cfx.lua')
-- Load QBCore mocks
print('\n[Loading QBCore Mocks]')
loadFile('qbcore/init.lua')
loadFile('qbcore/player.lua')
loadFile('qbcore/functions_client.lua')
loadFile('qbcore/functions_server.lua')
print('\n========================================')
print(' LuaGround Ready!')
print('========================================')
print('')
print('Available globals:')
print(' - QBCore (Framework)')
print(' - MockReturnValue (Set mock returns)')
print(' - MockStorage (Internal storage)')
print(' - MockEvents (Event tracking)')
print('')
print('Quick Start:')
print(' local player = QBCore.Player.CreateMockPlayer(1)')
print(' player.Functions.SetJob("police", 2)')
print(' player.Functions.AddMoney("cash", 500)')
print('')