@quenty/humanoidutils 2.21.1 → 2.22.1-canary.871.45514075951.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.
- package/CHANGELOG.md +12 -0
- package/package.json +9 -9
- package/src/Shared/RxHumanoidUtils.spec.lua +35 -40
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.22.1-canary.871.45514075951.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/humanoidutils@2.21.2...@quenty/humanoidutils@2.22.1-canary.871.45514075951.0) (2026-11-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/humanoidutils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.21.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/humanoidutils@2.21.1...@quenty/humanoidutils@2.21.2) (2026-11-18)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @quenty/humanoidutils
|
|
17
|
+
|
|
6
18
|
## [2.21.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/humanoidutils@2.21.0...@quenty/humanoidutils@2.21.1) (2026-10-20)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/humanoidutils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.1-canary.871.45514075951.0",
|
|
4
4
|
"description": "General humanoid utility code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@quenty/instanceutils": "13.
|
|
35
|
-
"@quenty/jestutils": "1.1.
|
|
36
|
-
"@quenty/loader": "10.
|
|
37
|
-
"@quenty/maid": "3.
|
|
38
|
-
"@quenty/nevermore-test-runner": "1.
|
|
39
|
-
"@quenty/rx": "13.
|
|
40
|
-
"@quentystudios/jest-lua": "3.10.0-quenty.
|
|
34
|
+
"@quenty/instanceutils": "13.39.1-canary.871.45514075951.0",
|
|
35
|
+
"@quenty/jestutils": "1.2.1-canary.871.45514075951.0",
|
|
36
|
+
"@quenty/loader": "10.12.1-canary.871.45514075951.0",
|
|
37
|
+
"@quenty/maid": "3.13.1-canary.871.45514075951.0",
|
|
38
|
+
"@quenty/nevermore-test-runner": "1.7.1-canary.871.45514075951.0",
|
|
39
|
+
"@quenty/rx": "13.36.1-canary.871.45514075951.0",
|
|
40
|
+
"@quentystudios/jest-lua": "3.10.0-quenty.3"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "185a4ff431bea3f210fd9f1cc91c325dba6b734f"
|
|
43
43
|
}
|
|
@@ -8,7 +8,9 @@ local require = require(script.Parent.loader).load(script)
|
|
|
8
8
|
local Jest = require("Jest")
|
|
9
9
|
local JestUtils = require("JestUtils")
|
|
10
10
|
local Maid = require("Maid")
|
|
11
|
+
local ObservableSpy = require("ObservableSpy")
|
|
11
12
|
local RxHumanoidUtils = require("RxHumanoidUtils")
|
|
13
|
+
local RxTestUtils = require("RxTestUtils")
|
|
12
14
|
|
|
13
15
|
local describe = Jest.Globals.describe
|
|
14
16
|
local expect = Jest.Globals.expect
|
|
@@ -21,22 +23,7 @@ local function setup(): any
|
|
|
21
23
|
newHumanoid = function(): Humanoid
|
|
22
24
|
return maid:Add(Instance.new("Humanoid"))
|
|
23
25
|
end,
|
|
24
|
-
|
|
25
|
-
local values = {}
|
|
26
|
-
maid:GiveTask(observable:Subscribe(function(value)
|
|
27
|
-
table.insert(values, value)
|
|
28
|
-
end))
|
|
29
|
-
return values
|
|
30
|
-
end,
|
|
31
|
-
recordUntilStopped = function(observable: any): ({ any }, () -> ())
|
|
32
|
-
local values = {}
|
|
33
|
-
local subscription = maid:Add(observable:Subscribe(function(value)
|
|
34
|
-
table.insert(values, value)
|
|
35
|
-
end))
|
|
36
|
-
return values, function()
|
|
37
|
-
subscription:Destroy()
|
|
38
|
-
end
|
|
39
|
-
end,
|
|
26
|
+
maid = maid,
|
|
40
27
|
Destroy = function(_self)
|
|
41
28
|
maid:DoCleaning()
|
|
42
29
|
end,
|
|
@@ -64,7 +51,7 @@ describe("RxHumanoidUtils.observeRunningSpeed", function()
|
|
|
64
51
|
local controller = setup()
|
|
65
52
|
local humanoid = controller.newHumanoid()
|
|
66
53
|
|
|
67
|
-
local speeds = controller.
|
|
54
|
+
local speeds = RxTestUtils.collectList(controller.maid, RxHumanoidUtils.observeRunningSpeed(humanoid))
|
|
68
55
|
|
|
69
56
|
expect(speeds).toEqual({ 0 })
|
|
70
57
|
|
|
@@ -77,7 +64,7 @@ describe("RxHumanoidUtils.observeHumanoidStateType", function()
|
|
|
77
64
|
local controller = setup()
|
|
78
65
|
local humanoid = controller.newHumanoid()
|
|
79
66
|
|
|
80
|
-
local stateTypes = controller.
|
|
67
|
+
local stateTypes = RxTestUtils.collectList(controller.maid, RxHumanoidUtils.observeHumanoidStateType(humanoid))
|
|
81
68
|
|
|
82
69
|
expect(stateTypes).toEqual({ humanoid:GetState() })
|
|
83
70
|
|
|
@@ -111,8 +98,10 @@ describe("RxHumanoidUtils.observeHumanoidStateEnabled", function()
|
|
|
111
98
|
local controller = setup()
|
|
112
99
|
local humanoid = controller.newHumanoid()
|
|
113
100
|
|
|
114
|
-
local enabled =
|
|
115
|
-
controller.
|
|
101
|
+
local enabled = RxTestUtils.collectList(
|
|
102
|
+
controller.maid,
|
|
103
|
+
RxHumanoidUtils.observeHumanoidStateEnabled(humanoid, Enum.HumanoidStateType.Jumping)
|
|
104
|
+
)
|
|
116
105
|
|
|
117
106
|
expect(enabled).toEqual({ true })
|
|
118
107
|
|
|
@@ -123,8 +112,10 @@ describe("RxHumanoidUtils.observeHumanoidStateEnabled", function()
|
|
|
123
112
|
local controller = setup()
|
|
124
113
|
local humanoid = controller.newHumanoid()
|
|
125
114
|
|
|
126
|
-
local enabled =
|
|
127
|
-
controller.
|
|
115
|
+
local enabled = RxTestUtils.collectList(
|
|
116
|
+
controller.maid,
|
|
117
|
+
RxHumanoidUtils.observeHumanoidStateEnabled(humanoid, Enum.HumanoidStateType.Jumping)
|
|
118
|
+
)
|
|
128
119
|
|
|
129
120
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
|
|
130
121
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
|
|
@@ -138,8 +129,10 @@ describe("RxHumanoidUtils.observeHumanoidStateEnabled", function()
|
|
|
138
129
|
local controller = setup()
|
|
139
130
|
local humanoid = controller.newHumanoid()
|
|
140
131
|
|
|
141
|
-
local enabled =
|
|
142
|
-
controller.
|
|
132
|
+
local enabled = RxTestUtils.collectList(
|
|
133
|
+
controller.maid,
|
|
134
|
+
RxHumanoidUtils.observeHumanoidStateEnabled(humanoid, Enum.HumanoidStateType.Jumping)
|
|
135
|
+
)
|
|
143
136
|
|
|
144
137
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
|
|
145
138
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
|
|
@@ -154,8 +147,10 @@ describe("RxHumanoidUtils.observeHumanoidStateEnabled", function()
|
|
|
154
147
|
local controller = setup()
|
|
155
148
|
local humanoid = controller.newHumanoid()
|
|
156
149
|
|
|
157
|
-
local enabled =
|
|
158
|
-
controller.
|
|
150
|
+
local enabled = RxTestUtils.collectList(
|
|
151
|
+
controller.maid,
|
|
152
|
+
RxHumanoidUtils.observeHumanoidStateEnabled(humanoid, Enum.HumanoidStateType.Jumping)
|
|
153
|
+
)
|
|
159
154
|
|
|
160
155
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
|
|
161
156
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
|
|
@@ -169,14 +164,14 @@ describe("RxHumanoidUtils.observeHumanoidStateEnabled", function()
|
|
|
169
164
|
local controller = setup()
|
|
170
165
|
local humanoid = controller.newHumanoid()
|
|
171
166
|
|
|
172
|
-
local enabled
|
|
173
|
-
RxHumanoidUtils.observeHumanoidStateEnabled(humanoid, Enum.HumanoidStateType.Jumping)
|
|
167
|
+
local enabled = controller.maid:Add(
|
|
168
|
+
ObservableSpy.new(RxHumanoidUtils.observeHumanoidStateEnabled(humanoid, Enum.HumanoidStateType.Jumping))
|
|
174
169
|
)
|
|
175
170
|
|
|
176
|
-
|
|
171
|
+
enabled:Destroy()
|
|
177
172
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
|
|
178
173
|
|
|
179
|
-
expect(enabled).toEqual({ true })
|
|
174
|
+
expect(enabled.Values).toEqual({ true })
|
|
180
175
|
|
|
181
176
|
controller:Destroy()
|
|
182
177
|
end)
|
|
@@ -197,7 +192,7 @@ describe("RxHumanoidUtils.observeJumpEnabled", function()
|
|
|
197
192
|
local controller = setup()
|
|
198
193
|
local humanoid = controller.newHumanoid()
|
|
199
194
|
|
|
200
|
-
local enabled = controller.
|
|
195
|
+
local enabled = RxTestUtils.collectList(controller.maid, RxHumanoidUtils.observeJumpEnabled(humanoid))
|
|
201
196
|
|
|
202
197
|
expect(enabled).toEqual({ true })
|
|
203
198
|
|
|
@@ -208,7 +203,7 @@ describe("RxHumanoidUtils.observeJumpEnabled", function()
|
|
|
208
203
|
local controller = setup()
|
|
209
204
|
local humanoid = controller.newHumanoid()
|
|
210
205
|
|
|
211
|
-
local enabled = controller.
|
|
206
|
+
local enabled = RxTestUtils.collectList(controller.maid, RxHumanoidUtils.observeJumpEnabled(humanoid))
|
|
212
207
|
|
|
213
208
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
|
|
214
209
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
|
|
@@ -224,7 +219,7 @@ describe("RxHumanoidUtils.observeJumpEnabled", function()
|
|
|
224
219
|
humanoid.UseJumpPower = true
|
|
225
220
|
humanoid.JumpHeight = 0
|
|
226
221
|
|
|
227
|
-
local enabled = controller.
|
|
222
|
+
local enabled = RxTestUtils.collectList(controller.maid, RxHumanoidUtils.observeJumpEnabled(humanoid))
|
|
228
223
|
|
|
229
224
|
humanoid.JumpPower = 0
|
|
230
225
|
humanoid.JumpPower = 50
|
|
@@ -240,7 +235,7 @@ describe("RxHumanoidUtils.observeJumpEnabled", function()
|
|
|
240
235
|
humanoid.UseJumpPower = false
|
|
241
236
|
humanoid.JumpPower = 0
|
|
242
237
|
|
|
243
|
-
local enabled = controller.
|
|
238
|
+
local enabled = RxTestUtils.collectList(controller.maid, RxHumanoidUtils.observeJumpEnabled(humanoid))
|
|
244
239
|
|
|
245
240
|
humanoid.JumpHeight = 0
|
|
246
241
|
humanoid.JumpHeight = 7
|
|
@@ -257,7 +252,7 @@ describe("RxHumanoidUtils.observeJumpEnabled", function()
|
|
|
257
252
|
humanoid.JumpPower = 50
|
|
258
253
|
humanoid.JumpHeight = 0
|
|
259
254
|
|
|
260
|
-
local enabled = controller.
|
|
255
|
+
local enabled = RxTestUtils.collectList(controller.maid, RxHumanoidUtils.observeJumpEnabled(humanoid))
|
|
261
256
|
|
|
262
257
|
humanoid.UseJumpPower = false
|
|
263
258
|
humanoid.UseJumpPower = true
|
|
@@ -273,7 +268,7 @@ describe("RxHumanoidUtils.observeJumpEnabled", function()
|
|
|
273
268
|
humanoid.UseJumpPower = true
|
|
274
269
|
humanoid.JumpPower = 50
|
|
275
270
|
|
|
276
|
-
local enabled = controller.
|
|
271
|
+
local enabled = RxTestUtils.collectList(controller.maid, RxHumanoidUtils.observeJumpEnabled(humanoid))
|
|
277
272
|
|
|
278
273
|
humanoid.JumpHeight = 0
|
|
279
274
|
humanoid.JumpHeight = 12
|
|
@@ -289,7 +284,7 @@ describe("RxHumanoidUtils.observeJumpEnabled", function()
|
|
|
289
284
|
humanoid.JumpPower = 0
|
|
290
285
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
|
|
291
286
|
|
|
292
|
-
local enabled = controller.
|
|
287
|
+
local enabled = RxTestUtils.collectList(controller.maid, RxHumanoidUtils.observeJumpEnabled(humanoid))
|
|
293
288
|
|
|
294
289
|
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
|
|
295
290
|
humanoid.JumpPower = 50
|
|
@@ -303,12 +298,12 @@ describe("RxHumanoidUtils.observeJumpEnabled", function()
|
|
|
303
298
|
local controller = setup()
|
|
304
299
|
local humanoid = controller.newHumanoid()
|
|
305
300
|
|
|
306
|
-
local enabled
|
|
301
|
+
local enabled = controller.maid:Add(ObservableSpy.new(RxHumanoidUtils.observeJumpEnabled(humanoid)))
|
|
307
302
|
|
|
308
|
-
|
|
303
|
+
enabled:Destroy()
|
|
309
304
|
humanoid.JumpPower = 0
|
|
310
305
|
|
|
311
|
-
expect(enabled).toEqual({ true })
|
|
306
|
+
expect(enabled.Values).toEqual({ true })
|
|
312
307
|
|
|
313
308
|
controller:Destroy()
|
|
314
309
|
end)
|