@isentinel/jest-roblox 0.2.7 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -1,9 +0,0 @@
1
- --!strict
2
- local HttpService = game:GetService("HttpService")
3
-
4
- local Runner = require(script.Parent:FindFirstChild('runner'))
5
-
6
- local payload = HttpService:JSONDecode([=[__CONFIG_JSON__]=])
7
- local entries = Runner.runProjects(script, payload.configs)
8
-
9
- return HttpService:JSONEncode({ entries = entries }), "[]"
@@ -1,88 +0,0 @@
1
- --!strict
2
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
3
-
4
- local module = {}
5
-
6
- function module.findInstance(path: string): Instance
7
- local parts = string.split(path, "/")
8
-
9
- local success, current = pcall(function()
10
- return game:FindService(parts[1])
11
- end)
12
- assert(success, `Failed to find service {parts[1]}: {current}`)
13
-
14
- for i = 2, #parts do
15
- assert(current, `Failed to find '{parts[i - 1]}' in path {path}`)
16
- current = current:FindFirstChild(parts[i])
17
- end
18
-
19
- assert(current, `Failed to find instance at path {path}`)
20
-
21
- return current
22
- end
23
-
24
- function module.getJest(config: { jestPath: string? }): ModuleScript
25
- local jestPath = config.jestPath
26
- if jestPath then
27
- local instance = module.findInstance(jestPath)
28
- assert(instance, `Failed to find Jest instance at path {jestPath}`)
29
- assert(instance:IsA("ModuleScript"), `Instance at path {jestPath} is not a ModuleScript`)
30
- return instance :: ModuleScript
31
- end
32
-
33
- local jestInstance = ReplicatedStorage:FindFirstChild("Jest", true)
34
- assert(jestInstance, "Failed to find Jest instance in ReplicatedStorage")
35
- assert(jestInstance:IsA("ModuleScript"), "Jest instance in ReplicatedStorage is not a ModuleScript")
36
- return jestInstance
37
- end
38
-
39
- function module.findRobloxShared(jestModule: ModuleScript): Instance?
40
- local parent = jestModule.Parent
41
- if parent then
42
- local found = parent:FindFirstChild("RobloxShared") or parent:FindFirstChild("jest-roblox-shared")
43
- if found then
44
- return found
45
- end
46
-
47
- if parent.Parent then
48
- found = parent.Parent:FindFirstChild("RobloxShared") or parent.Parent:FindFirstChild("jest-roblox-shared")
49
- if found then
50
- return found
51
- end
52
- end
53
- end
54
-
55
- return game:FindFirstChild("RobloxShared", true)
56
- end
57
-
58
- function module.findSiblingPackage(jestModule: ModuleScript, ...: string): Instance?
59
- local parent = jestModule.Parent
60
- if parent then
61
- for _, name in { ... } do
62
- local found = parent:FindFirstChild(name)
63
- if found then
64
- return found
65
- end
66
- end
67
-
68
- if parent.Parent then
69
- for _, name in { ... } do
70
- local found = parent.Parent:FindFirstChild(name)
71
- if found then
72
- return found
73
- end
74
- end
75
- end
76
- end
77
-
78
- for _, name in { ... } do
79
- local found = game:FindFirstChild(name, true)
80
- if found then
81
- return found
82
- end
83
- end
84
-
85
- return nil
86
- end
87
-
88
- return module
@@ -1,19 +0,0 @@
1
- --!strict
2
- local function getInstancePath(instance: Instance): string
3
- local parts = {} :: { string }
4
- local current: Instance? = instance
5
- while current and current ~= game do
6
- table.insert(parts, 1, current.Name)
7
- current = current.Parent
8
- end
9
-
10
- return table.concat(parts, "/")
11
- end
12
-
13
- local CoreScriptSyncService = {}
14
-
15
- function CoreScriptSyncService:GetScriptFilePath(instance: Instance): string
16
- return getInstancePath(instance)
17
- end
18
-
19
- return CoreScriptSyncService
@@ -1,30 +0,0 @@
1
- --!strict
2
- local function normalizeSnapPath(path: string): string
3
- return (string.gsub(path, "%.snap%.lua$", ".snap.luau"))
4
- end
5
-
6
- local function create(snapshotWrites: { [string]: string })
7
- local FileSystemService = {}
8
-
9
- function FileSystemService:WriteFile(path: string, contents: string)
10
- snapshotWrites[normalizeSnapPath(path)] = contents
11
- end
12
-
13
- function FileSystemService:CreateDirectories(_path: string) end
14
-
15
- function FileSystemService:Exists(path: string): boolean
16
- return snapshotWrites[normalizeSnapPath(path)] ~= nil
17
- end
18
-
19
- function FileSystemService:Remove(path: string)
20
- snapshotWrites[normalizeSnapPath(path)] = nil
21
- end
22
-
23
- function FileSystemService:IsRegularFile(path: string): boolean
24
- return snapshotWrites[normalizeSnapPath(path)] ~= nil
25
- end
26
-
27
- return FileSystemService
28
- end
29
-
30
- return create