@quenty/adorneeboundingbox 8.49.0 → 8.51.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
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
# [8.51.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/adorneeboundingbox@8.50.0...@quenty/adorneeboundingbox@8.51.0) (2026-09-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/adorneeboundingbox
|
|
9
|
+
|
|
10
|
+
# [8.50.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/adorneeboundingbox@8.49.0...@quenty/adorneeboundingbox@8.50.0) (2026-08-28)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @quenty/adorneeboundingbox
|
|
13
|
+
|
|
6
14
|
# [8.49.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/adorneeboundingbox@8.48.1...@quenty/adorneeboundingbox@8.49.0) (2026-08-28)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @quenty/adorneeboundingbox
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/adorneeboundingbox",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.51.0",
|
|
4
4
|
"description": "Handles logic for reactive bounding box monitoring",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -29,22 +29,23 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@quenty/baseobject": "10.16.0",
|
|
32
|
-
"@quenty/brio": "14.
|
|
32
|
+
"@quenty/brio": "14.37.0",
|
|
33
33
|
"@quenty/draw": "7.17.0",
|
|
34
|
-
"@quenty/instanceutils": "13.
|
|
34
|
+
"@quenty/instanceutils": "13.37.0",
|
|
35
|
+
"@quenty/jestutils": "1.1.0",
|
|
35
36
|
"@quenty/loader": "10.11.1",
|
|
36
37
|
"@quenty/maid": "3.12.0",
|
|
37
38
|
"@quenty/nevermore-test-runner": "1.6.0",
|
|
38
|
-
"@quenty/observablecollection": "12.
|
|
39
|
+
"@quenty/observablecollection": "12.51.0",
|
|
39
40
|
"@quenty/rx": "13.34.0",
|
|
40
|
-
"@quenty/selectionutils": "8.
|
|
41
|
+
"@quenty/selectionutils": "8.38.0",
|
|
41
42
|
"@quenty/signal": "7.13.2",
|
|
42
|
-
"@quenty/valueobject": "13.
|
|
43
|
+
"@quenty/valueobject": "13.38.0",
|
|
43
44
|
"@quentystudios/jest-lua": "3.10.0-quenty.2",
|
|
44
45
|
"@quentystudios/t": "^3.0.0"
|
|
45
46
|
},
|
|
46
47
|
"publishConfig": {
|
|
47
48
|
"access": "public"
|
|
48
49
|
},
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "278f4ca25486a8ba0601704b27a11da8c77499c9"
|
|
50
51
|
}
|
|
@@ -7,6 +7,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
|
|
8
8
|
local AdorneeBoundingBox = require("AdorneeBoundingBox")
|
|
9
9
|
local Jest = require("Jest")
|
|
10
|
+
local JestUtils = require("JestUtils")
|
|
10
11
|
local Maid = require("Maid")
|
|
11
12
|
|
|
12
13
|
local describe = Jest.Globals.describe
|
|
@@ -27,7 +28,7 @@ type Controller = {
|
|
|
27
28
|
newBoundingBox: (adornee: Instance?) -> AdorneeBoundingBox.AdorneeBoundingBox,
|
|
28
29
|
collect: (observable: any) -> Record,
|
|
29
30
|
step: (count: number?) -> (),
|
|
30
|
-
|
|
31
|
+
Destroy: (self: Controller) -> (),
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
local function setup(): Controller
|
|
@@ -102,11 +103,13 @@ local function setup(): Controller
|
|
|
102
103
|
end
|
|
103
104
|
end,
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
Destroy = function(_self)
|
|
106
107
|
maid:DoCleaning()
|
|
107
108
|
end,
|
|
108
109
|
}
|
|
109
110
|
|
|
111
|
+
maid:GiveTask(JestUtils.afterThis(controller))
|
|
112
|
+
|
|
110
113
|
return controller
|
|
111
114
|
end
|
|
112
115
|
|
|
@@ -119,7 +122,7 @@ describe("AdorneeBoundingBox.new", function()
|
|
|
119
122
|
expect(boundingBox:GetCFrame()).toBeNil()
|
|
120
123
|
expect(boundingBox:GetBoundingBox()).toBeNil()
|
|
121
124
|
|
|
122
|
-
controller
|
|
125
|
+
controller:Destroy()
|
|
123
126
|
end)
|
|
124
127
|
|
|
125
128
|
it("does not emit a bounding box with no adornee", function()
|
|
@@ -132,7 +135,7 @@ describe("AdorneeBoundingBox.new", function()
|
|
|
132
135
|
|
|
133
136
|
expect(record.count).toBe(0)
|
|
134
137
|
|
|
135
|
-
controller
|
|
138
|
+
controller:Destroy()
|
|
136
139
|
end)
|
|
137
140
|
end)
|
|
138
141
|
|
|
@@ -145,7 +148,7 @@ describe("AdorneeBoundingBox with a part adornee", function()
|
|
|
145
148
|
|
|
146
149
|
expect(boundingBox:GetSize()).toEqual(Vector3.new(4, 1, 2))
|
|
147
150
|
|
|
148
|
-
controller
|
|
151
|
+
controller:Destroy()
|
|
149
152
|
end)
|
|
150
153
|
|
|
151
154
|
it("reports the cframe immediately", function()
|
|
@@ -156,7 +159,7 @@ describe("AdorneeBoundingBox with a part adornee", function()
|
|
|
156
159
|
|
|
157
160
|
expect(boundingBox:GetCFrame()).toEqual(CFrame.new(1, 2, 3))
|
|
158
161
|
|
|
159
|
-
controller
|
|
162
|
+
controller:Destroy()
|
|
160
163
|
end)
|
|
161
164
|
|
|
162
165
|
it("returns both halves from GetBoundingBox", function()
|
|
@@ -171,7 +174,7 @@ describe("AdorneeBoundingBox with a part adornee", function()
|
|
|
171
174
|
expect((data :: any).Size).toEqual(Vector3.new(4, 1, 2))
|
|
172
175
|
expect((data :: any).CFrame).toEqual(CFrame.new(1, 2, 3))
|
|
173
176
|
|
|
174
|
-
controller
|
|
177
|
+
controller:Destroy()
|
|
175
178
|
end)
|
|
176
179
|
|
|
177
180
|
it("emits a bounding box", function()
|
|
@@ -185,7 +188,7 @@ describe("AdorneeBoundingBox with a part adornee", function()
|
|
|
185
188
|
expect(record.values[1].Size).toEqual(Vector3.new(4, 1, 2))
|
|
186
189
|
expect(record.values[1].CFrame).toEqual(CFrame.new(1, 2, 3))
|
|
187
190
|
|
|
188
|
-
controller
|
|
191
|
+
controller:Destroy()
|
|
189
192
|
end)
|
|
190
193
|
|
|
191
194
|
it("tracks changes to the part", function()
|
|
@@ -201,7 +204,7 @@ describe("AdorneeBoundingBox with a part adornee", function()
|
|
|
201
204
|
expect(boundingBox:GetSize()).toEqual(Vector3.new(9, 9, 9))
|
|
202
205
|
expect(boundingBox:GetCFrame()).toEqual(CFrame.new(0, 100, 0))
|
|
203
206
|
|
|
204
|
-
controller
|
|
207
|
+
controller:Destroy()
|
|
205
208
|
end)
|
|
206
209
|
end)
|
|
207
210
|
|
|
@@ -215,7 +218,7 @@ describe("AdorneeBoundingBox with a model adornee", function()
|
|
|
215
218
|
controller.newBoundingBox(model)
|
|
216
219
|
end).never.toThrow()
|
|
217
220
|
|
|
218
|
-
controller
|
|
221
|
+
controller:Destroy()
|
|
219
222
|
end)
|
|
220
223
|
|
|
221
224
|
it("matches the engine bounding box after a step", function()
|
|
@@ -231,7 +234,7 @@ describe("AdorneeBoundingBox with a model adornee", function()
|
|
|
231
234
|
expect(boundingBox:GetSize()).toEqual(expectedSize)
|
|
232
235
|
expect(boundingBox:GetCFrame()).toEqual(expectedCFrame)
|
|
233
236
|
|
|
234
|
-
controller
|
|
237
|
+
controller:Destroy()
|
|
235
238
|
end)
|
|
236
239
|
|
|
237
240
|
it("emits a bounding box once measured", function()
|
|
@@ -249,7 +252,7 @@ describe("AdorneeBoundingBox with a model adornee", function()
|
|
|
249
252
|
expect(record.values[record.count].Size).toEqual(expectedSize)
|
|
250
253
|
expect(record.values[record.count].CFrame).toEqual(expectedCFrame)
|
|
251
254
|
|
|
252
|
-
controller
|
|
255
|
+
controller:Destroy()
|
|
253
256
|
end)
|
|
254
257
|
end)
|
|
255
258
|
|
|
@@ -263,7 +266,7 @@ describe("AdorneeBoundingBox with a humanoid adornee", function()
|
|
|
263
266
|
controller.newBoundingBox(humanoid)
|
|
264
267
|
end).never.toThrow()
|
|
265
268
|
|
|
266
|
-
controller
|
|
269
|
+
controller:Destroy()
|
|
267
270
|
end)
|
|
268
271
|
|
|
269
272
|
it("uses the bounding box of the parent model", function()
|
|
@@ -278,7 +281,7 @@ describe("AdorneeBoundingBox with a humanoid adornee", function()
|
|
|
278
281
|
|
|
279
282
|
expect(boundingBox:GetSize()).toEqual(expectedSize)
|
|
280
283
|
|
|
281
|
-
controller
|
|
284
|
+
controller:Destroy()
|
|
282
285
|
end)
|
|
283
286
|
end)
|
|
284
287
|
|
|
@@ -293,7 +296,7 @@ describe("AdorneeBoundingBox with a tool adornee", function()
|
|
|
293
296
|
|
|
294
297
|
expect(boundingBox:GetCFrame()).toBeNil()
|
|
295
298
|
|
|
296
|
-
controller
|
|
299
|
+
controller:Destroy()
|
|
297
300
|
end)
|
|
298
301
|
|
|
299
302
|
it("uses the handle once it exists", function()
|
|
@@ -310,7 +313,7 @@ describe("AdorneeBoundingBox with a tool adornee", function()
|
|
|
310
313
|
expect(boundingBox:GetSize()).toEqual(Vector3.new(1, 2, 3))
|
|
311
314
|
expect(boundingBox:GetCFrame()).toEqual(CFrame.new(5, 0, 0))
|
|
312
315
|
|
|
313
|
-
controller
|
|
316
|
+
controller:Destroy()
|
|
314
317
|
end)
|
|
315
318
|
end)
|
|
316
319
|
|
|
@@ -326,7 +329,7 @@ describe("AdorneeBoundingBox with an attachment adornee", function()
|
|
|
326
329
|
|
|
327
330
|
expect(boundingBox:GetSize()).toEqual(Vector3.zero)
|
|
328
331
|
|
|
329
|
-
controller
|
|
332
|
+
controller:Destroy()
|
|
330
333
|
end)
|
|
331
334
|
|
|
332
335
|
it("reports the world cframe of the attachment", function()
|
|
@@ -343,7 +346,7 @@ describe("AdorneeBoundingBox with an attachment adornee", function()
|
|
|
343
346
|
expect(cframe).never.toBeNil()
|
|
344
347
|
expect((cframe :: CFrame).Position).toEqual(Vector3.new(10, 5, 0))
|
|
345
348
|
|
|
346
|
-
controller
|
|
349
|
+
controller:Destroy()
|
|
347
350
|
end)
|
|
348
351
|
end)
|
|
349
352
|
|
|
@@ -359,7 +362,7 @@ describe("AdorneeBoundingBox with an unsupported adornee", function()
|
|
|
359
362
|
expect(boundingBox:GetCFrame()).toBeNil()
|
|
360
363
|
|
|
361
364
|
folder:Destroy()
|
|
362
|
-
controller
|
|
365
|
+
controller:Destroy()
|
|
363
366
|
end)
|
|
364
367
|
|
|
365
368
|
it("never emits a bounding box", function()
|
|
@@ -374,7 +377,7 @@ describe("AdorneeBoundingBox with an unsupported adornee", function()
|
|
|
374
377
|
expect(record.count).toBe(0)
|
|
375
378
|
|
|
376
379
|
folder:Destroy()
|
|
377
|
-
controller
|
|
380
|
+
controller:Destroy()
|
|
378
381
|
end)
|
|
379
382
|
end)
|
|
380
383
|
|
|
@@ -388,7 +391,7 @@ describe("AdorneeBoundingBox:SetAdornee", function()
|
|
|
388
391
|
boundingBox:SetAdornee("not an instance" :: any)
|
|
389
392
|
end).toThrow()
|
|
390
393
|
|
|
391
|
-
controller
|
|
394
|
+
controller:Destroy()
|
|
392
395
|
end)
|
|
393
396
|
|
|
394
397
|
it("accepts nil", function()
|
|
@@ -400,7 +403,7 @@ describe("AdorneeBoundingBox:SetAdornee", function()
|
|
|
400
403
|
boundingBox:SetAdornee(nil)
|
|
401
404
|
end).never.toThrow()
|
|
402
405
|
|
|
403
|
-
controller
|
|
406
|
+
controller:Destroy()
|
|
404
407
|
end)
|
|
405
408
|
|
|
406
409
|
it("starts tracking the new adornee", function()
|
|
@@ -413,7 +416,7 @@ describe("AdorneeBoundingBox:SetAdornee", function()
|
|
|
413
416
|
|
|
414
417
|
expect(boundingBox:GetSize()).toEqual(Vector3.new(7, 7, 7))
|
|
415
418
|
|
|
416
|
-
controller
|
|
419
|
+
controller:Destroy()
|
|
417
420
|
end)
|
|
418
421
|
|
|
419
422
|
it("swaps between adornees", function()
|
|
@@ -427,7 +430,7 @@ describe("AdorneeBoundingBox:SetAdornee", function()
|
|
|
427
430
|
|
|
428
431
|
expect(boundingBox:GetSize()).toEqual(Vector3.new(8, 8, 8))
|
|
429
432
|
|
|
430
|
-
controller
|
|
433
|
+
controller:Destroy()
|
|
431
434
|
end)
|
|
432
435
|
|
|
433
436
|
it("returns a cleanup that stops tracking", function()
|
|
@@ -444,7 +447,7 @@ describe("AdorneeBoundingBox:SetAdornee", function()
|
|
|
444
447
|
|
|
445
448
|
expect(boundingBox:GetSize()).never.toEqual(Vector3.new(20, 20, 20))
|
|
446
449
|
|
|
447
|
-
controller
|
|
450
|
+
controller:Destroy()
|
|
448
451
|
end)
|
|
449
452
|
|
|
450
453
|
it("returns a cleanup that leaves a newer adornee alone", function()
|
|
@@ -460,7 +463,7 @@ describe("AdorneeBoundingBox:SetAdornee", function()
|
|
|
460
463
|
|
|
461
464
|
expect(boundingBox:GetSize()).toEqual(Vector3.new(8, 8, 8))
|
|
462
465
|
|
|
463
|
-
controller
|
|
466
|
+
controller:Destroy()
|
|
464
467
|
end)
|
|
465
468
|
end)
|
|
466
469
|
|
|
@@ -479,7 +482,7 @@ describe("AdorneeBoundingBox:Destroy", function()
|
|
|
479
482
|
|
|
480
483
|
expect(record.count).toBe(1)
|
|
481
484
|
|
|
482
|
-
controller
|
|
485
|
+
controller:Destroy()
|
|
483
486
|
end)
|
|
484
487
|
|
|
485
488
|
it("does not throw while tracking a model", function()
|
|
@@ -494,6 +497,6 @@ describe("AdorneeBoundingBox:Destroy", function()
|
|
|
494
497
|
boundingBox:Destroy()
|
|
495
498
|
end).never.toThrow()
|
|
496
499
|
|
|
497
|
-
controller
|
|
500
|
+
controller:Destroy()
|
|
498
501
|
end)
|
|
499
502
|
end)
|
|
@@ -7,6 +7,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
|
|
8
8
|
local AdorneeModelBoundingBox = require("AdorneeModelBoundingBox")
|
|
9
9
|
local Jest = require("Jest")
|
|
10
|
+
local JestUtils = require("JestUtils")
|
|
10
11
|
local Maid = require("Maid")
|
|
11
12
|
|
|
12
13
|
local describe = Jest.Globals.describe
|
|
@@ -24,7 +25,7 @@ type Controller = {
|
|
|
24
25
|
newBoundingBox: (model: Model) -> AdorneeModelBoundingBox.AdorneeModelBoundingBox,
|
|
25
26
|
collect: (observable: any) -> Record,
|
|
26
27
|
step: (count: number?) -> (),
|
|
27
|
-
|
|
28
|
+
Destroy: (self: Controller) -> (),
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
local function setup(): Controller
|
|
@@ -70,11 +71,13 @@ local function setup(): Controller
|
|
|
70
71
|
end
|
|
71
72
|
end,
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
Destroy = function(_self)
|
|
74
75
|
maid:DoCleaning()
|
|
75
76
|
end,
|
|
76
77
|
}
|
|
77
78
|
|
|
79
|
+
maid:GiveTask(JestUtils.afterThis(controller))
|
|
80
|
+
|
|
78
81
|
return controller
|
|
79
82
|
end
|
|
80
83
|
|
|
@@ -91,7 +94,7 @@ describe("AdorneeModelBoundingBox.new", function()
|
|
|
91
94
|
expect(record.count).toBe(1)
|
|
92
95
|
expect(record.values[1]).toBeNil()
|
|
93
96
|
|
|
94
|
-
controller
|
|
97
|
+
controller:Destroy()
|
|
95
98
|
end)
|
|
96
99
|
|
|
97
100
|
it("has no cframe until the first update runs", function()
|
|
@@ -106,7 +109,7 @@ describe("AdorneeModelBoundingBox.new", function()
|
|
|
106
109
|
expect(record.count).toBe(1)
|
|
107
110
|
expect(record.values[1]).toBeNil()
|
|
108
111
|
|
|
109
|
-
controller
|
|
112
|
+
controller:Destroy()
|
|
110
113
|
end)
|
|
111
114
|
|
|
112
115
|
it("matches the engine bounding box after a step", function()
|
|
@@ -126,7 +129,7 @@ describe("AdorneeModelBoundingBox.new", function()
|
|
|
126
129
|
expect(sizeRecord.values[sizeRecord.count]).toEqual(expectedSize)
|
|
127
130
|
expect(cframeRecord.values[cframeRecord.count]).toEqual(expectedCFrame)
|
|
128
131
|
|
|
129
|
-
controller
|
|
132
|
+
controller:Destroy()
|
|
130
133
|
end)
|
|
131
134
|
|
|
132
135
|
it("collapses several changes in one frame into a single update", function()
|
|
@@ -148,7 +151,7 @@ describe("AdorneeModelBoundingBox.new", function()
|
|
|
148
151
|
|
|
149
152
|
expect(record.count).toBe(settledCount + 1)
|
|
150
153
|
|
|
151
|
-
controller
|
|
154
|
+
controller:Destroy()
|
|
152
155
|
end)
|
|
153
156
|
end)
|
|
154
157
|
|
|
@@ -174,7 +177,7 @@ describe("AdorneeModelBoundingBox:ObserveSize", function()
|
|
|
174
177
|
expect(after).toEqual(expectedSize)
|
|
175
178
|
expect(after).never.toEqual(before)
|
|
176
179
|
|
|
177
|
-
controller
|
|
180
|
+
controller:Destroy()
|
|
178
181
|
end)
|
|
179
182
|
|
|
180
183
|
it("updates when a part is resized", function()
|
|
@@ -195,7 +198,7 @@ describe("AdorneeModelBoundingBox:ObserveSize", function()
|
|
|
195
198
|
|
|
196
199
|
expect(record.values[record.count]).toEqual(expectedSize)
|
|
197
200
|
|
|
198
|
-
controller
|
|
201
|
+
controller:Destroy()
|
|
199
202
|
end)
|
|
200
203
|
|
|
201
204
|
it("updates when a part is removed", function()
|
|
@@ -216,7 +219,7 @@ describe("AdorneeModelBoundingBox:ObserveSize", function()
|
|
|
216
219
|
|
|
217
220
|
expect(record.values[record.count]).never.toEqual(before)
|
|
218
221
|
|
|
219
|
-
controller
|
|
222
|
+
controller:Destroy()
|
|
220
223
|
end)
|
|
221
224
|
end)
|
|
222
225
|
|
|
@@ -241,7 +244,7 @@ describe("AdorneeModelBoundingBox:ObserveCFrame", function()
|
|
|
241
244
|
expect(after).never.toEqual(before)
|
|
242
245
|
expect(after.Position.Y).toBeCloseTo(50, 3)
|
|
243
246
|
|
|
244
|
-
controller
|
|
247
|
+
controller:Destroy()
|
|
245
248
|
end)
|
|
246
249
|
|
|
247
250
|
it("follows an unanchored part", function()
|
|
@@ -261,7 +264,7 @@ describe("AdorneeModelBoundingBox:ObserveCFrame", function()
|
|
|
261
264
|
|
|
262
265
|
expect(record.values[record.count].Position.Z).toBeCloseTo(30, 3)
|
|
263
266
|
|
|
264
|
-
controller
|
|
267
|
+
controller:Destroy()
|
|
265
268
|
end)
|
|
266
269
|
end)
|
|
267
270
|
|
|
@@ -285,7 +288,7 @@ describe("AdorneeModelBoundingBox:Destroy", function()
|
|
|
285
288
|
|
|
286
289
|
expect(record.count).toBe(settledCount)
|
|
287
290
|
|
|
288
|
-
controller
|
|
291
|
+
controller:Destroy()
|
|
289
292
|
end)
|
|
290
293
|
|
|
291
294
|
it("stops the unanchored update loop", function()
|
|
@@ -304,6 +307,6 @@ describe("AdorneeModelBoundingBox:Destroy", function()
|
|
|
304
307
|
|
|
305
308
|
controller.step(2)
|
|
306
309
|
|
|
307
|
-
controller
|
|
310
|
+
controller:Destroy()
|
|
308
311
|
end)
|
|
309
312
|
end)
|
|
@@ -7,6 +7,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
|
|
8
8
|
local AdorneePartBoundingBox = require("AdorneePartBoundingBox")
|
|
9
9
|
local Jest = require("Jest")
|
|
10
|
+
local JestUtils = require("JestUtils")
|
|
10
11
|
local Maid = require("Maid")
|
|
11
12
|
|
|
12
13
|
local describe = Jest.Globals.describe
|
|
@@ -23,7 +24,7 @@ type Controller = {
|
|
|
23
24
|
newBoundingBox: (part: BasePart) -> AdorneePartBoundingBox.AdorneePartBoundingBox,
|
|
24
25
|
collect: (observable: any) -> Record,
|
|
25
26
|
step: (count: number?) -> (),
|
|
26
|
-
|
|
27
|
+
Destroy: (self: Controller) -> (),
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
local function setup(): Controller
|
|
@@ -63,11 +64,13 @@ local function setup(): Controller
|
|
|
63
64
|
end
|
|
64
65
|
end,
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
Destroy = function(_self)
|
|
67
68
|
maid:DoCleaning()
|
|
68
69
|
end,
|
|
69
70
|
}
|
|
70
71
|
|
|
72
|
+
maid:GiveTask(JestUtils.afterThis(controller))
|
|
73
|
+
|
|
71
74
|
return controller
|
|
72
75
|
end
|
|
73
76
|
|
|
@@ -79,7 +82,7 @@ describe("AdorneePartBoundingBox.new", function()
|
|
|
79
82
|
AdorneePartBoundingBox.new(Instance.new("Folder") :: any)
|
|
80
83
|
end).toThrow()
|
|
81
84
|
|
|
82
|
-
controller
|
|
85
|
+
controller:Destroy()
|
|
83
86
|
end)
|
|
84
87
|
|
|
85
88
|
it("seeds the size from the part", function()
|
|
@@ -92,7 +95,7 @@ describe("AdorneePartBoundingBox.new", function()
|
|
|
92
95
|
expect(record.count).toBe(1)
|
|
93
96
|
expect(record.values[1]).toEqual(Vector3.new(4, 1, 2))
|
|
94
97
|
|
|
95
|
-
controller
|
|
98
|
+
controller:Destroy()
|
|
96
99
|
end)
|
|
97
100
|
|
|
98
101
|
it("seeds the cframe from the part", function()
|
|
@@ -105,7 +108,7 @@ describe("AdorneePartBoundingBox.new", function()
|
|
|
105
108
|
expect(record.count).toBe(1)
|
|
106
109
|
expect(record.values[1]).toEqual(CFrame.new(1, 2, 3))
|
|
107
110
|
|
|
108
|
-
controller
|
|
111
|
+
controller:Destroy()
|
|
109
112
|
end)
|
|
110
113
|
end)
|
|
111
114
|
|
|
@@ -123,7 +126,7 @@ describe("AdorneePartBoundingBox:ObserveSize", function()
|
|
|
123
126
|
expect(record.count).toBe(2)
|
|
124
127
|
expect(record.values[2]).toEqual(Vector3.new(8, 3, 5))
|
|
125
128
|
|
|
126
|
-
controller
|
|
129
|
+
controller:Destroy()
|
|
127
130
|
end)
|
|
128
131
|
|
|
129
132
|
it("does not emit when the size is unchanged", function()
|
|
@@ -138,7 +141,7 @@ describe("AdorneePartBoundingBox:ObserveSize", function()
|
|
|
138
141
|
|
|
139
142
|
expect(record.count).toBe(1)
|
|
140
143
|
|
|
141
|
-
controller
|
|
144
|
+
controller:Destroy()
|
|
142
145
|
end)
|
|
143
146
|
end)
|
|
144
147
|
|
|
@@ -156,7 +159,7 @@ describe("AdorneePartBoundingBox:ObserveCFrame", function()
|
|
|
156
159
|
expect(record.count).toBe(2)
|
|
157
160
|
expect(record.values[2]).toEqual(CFrame.new(10, 0, 0))
|
|
158
161
|
|
|
159
|
-
controller
|
|
162
|
+
controller:Destroy()
|
|
160
163
|
end)
|
|
161
164
|
|
|
162
165
|
it("keeps tracking an unanchored part", function()
|
|
@@ -174,7 +177,7 @@ describe("AdorneePartBoundingBox:ObserveCFrame", function()
|
|
|
174
177
|
|
|
175
178
|
expect(record.values[record.count]).toEqual(CFrame.new(0, 25, 0))
|
|
176
179
|
|
|
177
|
-
controller
|
|
180
|
+
controller:Destroy()
|
|
178
181
|
end)
|
|
179
182
|
end)
|
|
180
183
|
|
|
@@ -193,6 +196,6 @@ describe("AdorneePartBoundingBox:Destroy", function()
|
|
|
193
196
|
|
|
194
197
|
expect(record.count).toBe(1)
|
|
195
198
|
|
|
196
|
-
controller
|
|
199
|
+
controller:Destroy()
|
|
197
200
|
end)
|
|
198
201
|
end)
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
8
|
local Jest = require("Jest")
|
|
9
|
+
local JestUtils = require("JestUtils")
|
|
9
10
|
local Maid = require("Maid")
|
|
10
11
|
local RxPartBoundingBoxUtils = require("RxPartBoundingBoxUtils")
|
|
11
12
|
|
|
@@ -22,7 +23,7 @@ type Controller = {
|
|
|
22
23
|
newPart: (cframe: CFrame?) -> BasePart,
|
|
23
24
|
collect: (observable: any) -> Record,
|
|
24
25
|
step: (count: number?) -> (),
|
|
25
|
-
|
|
26
|
+
Destroy: (self: Controller) -> (),
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
local function setup(): Controller
|
|
@@ -57,11 +58,13 @@ local function setup(): Controller
|
|
|
57
58
|
end
|
|
58
59
|
end,
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
Destroy = function(_self)
|
|
61
62
|
maid:DoCleaning()
|
|
62
63
|
end,
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
maid:GiveTask(JestUtils.afterThis(controller))
|
|
67
|
+
|
|
65
68
|
return controller
|
|
66
69
|
end
|
|
67
70
|
|
|
@@ -73,7 +76,7 @@ describe("RxPartBoundingBoxUtils.observePartCFrame", function()
|
|
|
73
76
|
RxPartBoundingBoxUtils.observePartCFrame(Instance.new("Folder") :: any)
|
|
74
77
|
end).toThrow()
|
|
75
78
|
|
|
76
|
-
controller
|
|
79
|
+
controller:Destroy()
|
|
77
80
|
end)
|
|
78
81
|
|
|
79
82
|
it("emits the current cframe on subscribe", function()
|
|
@@ -85,7 +88,7 @@ describe("RxPartBoundingBoxUtils.observePartCFrame", function()
|
|
|
85
88
|
expect(record.count).toBe(1)
|
|
86
89
|
expect(record.values[1]).toEqual(CFrame.new(1, 2, 3))
|
|
87
90
|
|
|
88
|
-
controller
|
|
91
|
+
controller:Destroy()
|
|
89
92
|
end)
|
|
90
93
|
|
|
91
94
|
it("emits when the part moves", function()
|
|
@@ -100,7 +103,7 @@ describe("RxPartBoundingBoxUtils.observePartCFrame", function()
|
|
|
100
103
|
expect(record.count).toBe(2)
|
|
101
104
|
expect(record.values[2]).toEqual(CFrame.new(0, 40, 0))
|
|
102
105
|
|
|
103
|
-
controller
|
|
106
|
+
controller:Destroy()
|
|
104
107
|
end)
|
|
105
108
|
|
|
106
109
|
it("stops emitting once unsubscribed", function()
|
|
@@ -119,6 +122,6 @@ describe("RxPartBoundingBoxUtils.observePartCFrame", function()
|
|
|
119
122
|
|
|
120
123
|
expect(count).toBe(1)
|
|
121
124
|
|
|
122
|
-
controller
|
|
125
|
+
controller:Destroy()
|
|
123
126
|
end)
|
|
124
127
|
end)
|