@quenty/throttle 10.15.3 → 10.15.4
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,10 @@
|
|
|
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
|
+
## [10.15.4](https://github.com/Quenty/NevermoreEngine/compare/@quenty/throttle@10.15.3...@quenty/throttle@10.15.4) (2026-11-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/throttle
|
|
9
|
+
|
|
6
10
|
## [10.15.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/throttle@10.15.2...@quenty/throttle@10.15.3) (2026-10-20)
|
|
7
11
|
|
|
8
12
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/throttle",
|
|
3
|
-
"version": "10.15.
|
|
3
|
+
"version": "10.15.4",
|
|
4
4
|
"description": "Adds the throttle function to Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
"Quenty"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@quenty/jestutils": "1.1.4",
|
|
32
33
|
"@quenty/loader": "10.11.3",
|
|
33
|
-
"@quenty/nevermore-test-runner": "1.6.
|
|
34
|
+
"@quenty/nevermore-test-runner": "1.6.4",
|
|
34
35
|
"@quenty/typeutils": "1.3.3",
|
|
35
|
-
"@quentystudios/jest-lua": "3.10.0-quenty.
|
|
36
|
+
"@quentystudios/jest-lua": "3.10.0-quenty.3"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@quenty/loader": "workspace:*"
|
|
@@ -40,5 +41,5 @@
|
|
|
40
41
|
"publishConfig": {
|
|
41
42
|
"access": "public"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "f51b2de38a02f8d92758da8d381a378e760170aa"
|
|
44
45
|
}
|
|
@@ -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 ThrottledFunction = require("ThrottledFunction")
|
|
10
11
|
|
|
11
12
|
local describe = Jest.Globals.describe
|
|
@@ -30,7 +31,7 @@ end
|
|
|
30
31
|
|
|
31
32
|
describe("ThrottledFunction", function()
|
|
32
33
|
it("should drop cooldown calls when trailing is disabled", function()
|
|
33
|
-
|
|
34
|
+
JestUtils.useFakeTimers()
|
|
34
35
|
|
|
35
36
|
local calls, callback = recordCalls()
|
|
36
37
|
local throttled = ThrottledFunction.new(TIMEOUT, callback, {
|
|
@@ -47,11 +48,10 @@ describe("ThrottledFunction", function()
|
|
|
47
48
|
expect(calls[1][1]).toEqual("first")
|
|
48
49
|
|
|
49
50
|
throttled:Destroy()
|
|
50
|
-
jest.useRealTimers()
|
|
51
51
|
end)
|
|
52
52
|
|
|
53
53
|
it("should dispatch the latest trailing call with all arguments", function()
|
|
54
|
-
|
|
54
|
+
JestUtils.useFakeTimers()
|
|
55
55
|
|
|
56
56
|
local calls, callback = recordCalls()
|
|
57
57
|
local throttled = ThrottledFunction.new(TIMEOUT, callback, {
|
|
@@ -72,11 +72,10 @@ describe("ThrottledFunction", function()
|
|
|
72
72
|
expect(calls[2][3]).toEqual("fourth")
|
|
73
73
|
|
|
74
74
|
throttled:Destroy()
|
|
75
|
-
jest.useRealTimers()
|
|
76
75
|
end)
|
|
77
76
|
|
|
78
77
|
it("should delay trailing-only calls and keep the latest arguments", function()
|
|
79
|
-
|
|
78
|
+
JestUtils.useFakeTimers()
|
|
80
79
|
|
|
81
80
|
local calls, callback = recordCalls()
|
|
82
81
|
local throttled = ThrottledFunction.new(TIMEOUT, callback, {
|
|
@@ -95,11 +94,10 @@ describe("ThrottledFunction", function()
|
|
|
95
94
|
expect(calls[1][1]).toEqual("second, final and dispatched")
|
|
96
95
|
|
|
97
96
|
throttled:Destroy()
|
|
98
|
-
jest.useRealTimers()
|
|
99
97
|
end)
|
|
100
98
|
|
|
101
99
|
it("should cancel pending trailing calls when destroyed, not calling after destroyed", function()
|
|
102
|
-
|
|
100
|
+
JestUtils.useFakeTimers()
|
|
103
101
|
|
|
104
102
|
local calls, callback = recordCalls()
|
|
105
103
|
local throttled = ThrottledFunction.new(TIMEOUT, callback, {
|
|
@@ -112,8 +110,6 @@ describe("ThrottledFunction", function()
|
|
|
112
110
|
jest.advanceTimersByTime(TIMEOUT_MS)
|
|
113
111
|
|
|
114
112
|
expect(#calls).toEqual(0)
|
|
115
|
-
|
|
116
|
-
jest.useRealTimers()
|
|
117
113
|
end)
|
|
118
114
|
|
|
119
115
|
it("should reject if leading and trailing are both false", function()
|