@quenty/observablecollection 12.19.4 → 12.20.0-canary.544.de8fcee.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,9 +3,12 @@
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
- ## [12.19.4](https://github.com/Quenty/NevermoreEngine/compare/@quenty/observablecollection@12.19.3...@quenty/observablecollection@12.19.4) (2025-03-31)
6
+ # [12.20.0-canary.544.de8fcee.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/observablecollection@12.19.3...@quenty/observablecollection@12.20.0-canary.544.de8fcee.0) (2025-04-01)
7
7
 
8
- **Note:** Version bump only for package @quenty/observablecollection
8
+
9
+ ### Bug Fixes
10
+
11
+ * Fix existing tests ([655787c](https://github.com/Quenty/NevermoreEngine/commit/655787ced1139136e12f81800e229aa076731561))
9
12
 
10
13
 
11
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/observablecollection",
3
- "version": "12.19.4",
3
+ "version": "12.20.0-canary.544.de8fcee.0",
4
4
  "description": "A set of observable collections, such as sets, maps, sorted lists, and more.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -27,24 +27,24 @@
27
27
  "Quenty"
28
28
  ],
29
29
  "dependencies": {
30
- "@quenty/baseobject": "^10.8.0",
31
- "@quenty/brio": "^14.16.2",
32
- "@quenty/ducktype": "^5.8.1",
33
- "@quenty/loader": "^10.8.0",
34
- "@quenty/maid": "^3.4.0",
35
- "@quenty/promise": "^10.10.1",
36
- "@quenty/rx": "^13.16.2",
37
- "@quenty/signal": "^7.10.0",
38
- "@quenty/steputils": "^3.5.3",
39
- "@quenty/symbol": "^3.4.0",
40
- "@quenty/table": "^3.7.1",
41
- "@quenty/valueobject": "^13.16.2"
30
+ "@quenty/baseobject": "10.8.0",
31
+ "@quenty/brio": "14.17.0-canary.544.de8fcee.0",
32
+ "@quenty/ducktype": "5.8.1",
33
+ "@quenty/loader": "10.8.0",
34
+ "@quenty/maid": "3.4.0",
35
+ "@quenty/promise": "10.10.1",
36
+ "@quenty/rx": "13.17.0-canary.544.de8fcee.0",
37
+ "@quenty/signal": "7.10.0",
38
+ "@quenty/steputils": "3.5.3",
39
+ "@quenty/symbol": "3.4.0",
40
+ "@quenty/table": "3.7.1",
41
+ "@quenty/valueobject": "13.17.0-canary.544.de8fcee.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@quenty/blend": "^12.17.2"
44
+ "@quenty/blend": "12.18.0-canary.544.de8fcee.0"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "af926ec08f523833f37d22477c72dca034219823"
49
+ "gitHead": "de8fcee995fcdae464964357b4c770c03f4c7e03"
50
50
  }
@@ -4,35 +4,38 @@
4
4
 
5
5
  local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
6
6
 
7
+ local Jest = require("Jest")
7
8
  local ObservableCountingMap = require("ObservableCountingMap")
8
9
 
9
- return function()
10
- describe("ObservableCountingMap.new()", function()
11
- local observableCountingMap = ObservableCountingMap.new()
12
-
13
- it("should return 0 for unset values", function()
14
- expect(observableCountingMap:Get("a")).to.equal(0)
15
- expect(observableCountingMap:GetTotalKeyCount()).to.equal(0)
16
- end)
17
-
18
- it("should allow you to add to a value", function()
19
- expect(observableCountingMap:Get("a")).to.equal(0)
20
- expect(observableCountingMap:GetTotalKeyCount()).to.equal(0)
21
- observableCountingMap:Add("a", 5)
22
- expect(observableCountingMap:Get("a")).to.equal(5)
23
- expect(observableCountingMap:GetTotalKeyCount()).to.equal(1)
24
- end)
25
-
26
- it("should allow you to add to a value that is already defined", function()
27
- expect(observableCountingMap:Get("a")).to.equal(5)
28
- expect(observableCountingMap:GetTotalKeyCount()).to.equal(1)
29
- observableCountingMap:Add("a", 5)
30
- expect(observableCountingMap:Get("a")).to.equal(10)
31
- expect(observableCountingMap:GetTotalKeyCount()).to.equal(1)
32
- end)
33
-
34
- it("should clean up", function()
35
- observableCountingMap:Destroy()
36
- end)
10
+ local describe = Jest.Globals.describe
11
+ local expect = Jest.Globals.expect
12
+ local it = Jest.Globals.it
13
+
14
+ describe("ObservableCountingMap.new()", function()
15
+ local observableCountingMap = ObservableCountingMap.new()
16
+
17
+ it("should return 0 for unset values", function()
18
+ expect(observableCountingMap:Get("a")).toEqual(0)
19
+ expect(observableCountingMap:GetTotalKeyCount()).toEqual(0)
20
+ end)
21
+
22
+ it("should allow you to add to a value", function()
23
+ expect(observableCountingMap:Get("a")).toEqual(0)
24
+ expect(observableCountingMap:GetTotalKeyCount()).toEqual(0)
25
+ observableCountingMap:Add("a", 5)
26
+ expect(observableCountingMap:Get("a")).toEqual(5)
27
+ expect(observableCountingMap:GetTotalKeyCount()).toEqual(1)
28
+ end)
29
+
30
+ it("should allow you to add to a value that is already defined", function()
31
+ expect(observableCountingMap:Get("a")).toEqual(5)
32
+ expect(observableCountingMap:GetTotalKeyCount()).toEqual(1)
33
+ observableCountingMap:Add("a", 5)
34
+ expect(observableCountingMap:Get("a")).toEqual(10)
35
+ expect(observableCountingMap:GetTotalKeyCount()).toEqual(1)
36
+ end)
37
+
38
+ it("should clean up", function()
39
+ observableCountingMap:Destroy()
37
40
  end)
38
- end
41
+ end)
@@ -4,127 +4,131 @@
4
4
 
5
5
  local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
6
6
 
7
+ local Jest = require("Jest")
7
8
  local ObservableList = require("ObservableList")
8
9
 
9
- return function()
10
- describe("ObservableList.new()", function()
11
- local observableList = ObservableList.new()
10
+ local describe = Jest.Globals.describe
11
+ local expect = Jest.Globals.expect
12
+ local it = Jest.Globals.it
12
13
 
13
- it("should return nil for unset values", function()
14
- expect(observableList:Get(1)).to.equal(nil)
15
- end)
14
+ describe("ObservableList.new()", function()
15
+ local observableList = ObservableList.new()
16
16
 
17
- it("should allow inserting an value", function()
18
- expect(observableList:GetCount()).to.equal(0)
17
+ it("should return nil for unset values", function()
18
+ expect(observableList:Get(1)).toEqual(nil)
19
+ end)
19
20
 
20
- observableList:Add("a")
21
+ it("should allow inserting an value", function()
22
+ expect(observableList:GetCount()).toEqual(0)
21
23
 
22
- expect(observableList:Get(1)).to.equal("a")
23
- expect(observableList:GetCount()).to.equal(1)
24
- end)
24
+ observableList:Add("a")
25
25
 
26
- it("should allow negative queries", function()
27
- expect(observableList:Get(-1)).to.equal("a")
28
- expect(observableList:Get(-2)).to.equal(nil)
29
- end)
26
+ expect(observableList:Get(1)).toEqual("a")
27
+ expect(observableList:GetCount()).toEqual(1)
28
+ end)
30
29
 
31
- it("should allow false as a value", function()
32
- expect(observableList:Get(2)).to.equal(nil)
33
- observableList:Add(false)
34
- expect(observableList:Get(2)).to.equal(false)
35
- end)
30
+ it("should allow negative queries", function()
31
+ expect(observableList:Get(-1)).toEqual("a")
32
+ expect(observableList:Get(-2)).toEqual(nil)
33
+ end)
36
34
 
37
- it("should allow negative queries after false", function()
38
- expect(observableList:Get(1)).to.equal("a")
39
- expect(observableList:Get(2)).to.equal(false)
35
+ it("should allow false as a value", function()
36
+ expect(observableList:Get(2)).toEqual(nil)
37
+ observableList:Add(false)
38
+ expect(observableList:Get(2)).toEqual(false)
39
+ end)
40
40
 
41
- expect(observableList:Get(-1)).to.equal(false)
42
- expect(observableList:Get(-2)).to.equal("a")
41
+ it("should allow negative queries after false", function()
42
+ expect(observableList:Get(1)).toEqual("a")
43
+ expect(observableList:Get(2)).toEqual(false)
44
+
45
+ expect(observableList:Get(-1)).toEqual(false)
46
+ expect(observableList:Get(-2)).toEqual("a")
47
+ end)
48
+
49
+ it("should fire off events for a specific key", function()
50
+ local seen = {}
51
+ local sub = observableList:ObserveIndex(1):Subscribe(function(value)
52
+ table.insert(seen, value)
43
53
  end)
54
+ observableList:InsertAt("c", 1)
44
55
 
45
- it("should fire off events for a specific key", function()
46
- local seen = {}
47
- local sub = observableList:ObserveIndex(1):Subscribe(function(value)
48
- table.insert(seen, value)
49
- end)
50
- observableList:InsertAt("c", 1)
56
+ sub:Destroy()
51
57
 
52
- sub:Destroy()
58
+ expect(#seen).toEqual(2)
59
+ expect(seen[1]).toEqual(1)
60
+ expect(seen[2]).toEqual(2)
61
+ end)
53
62
 
54
- expect(#seen).to.equal(2)
55
- expect(seen[1]).to.equal(1)
56
- expect(seen[2]).to.equal(2)
63
+ it("should fire off events for all keys", function()
64
+ local seen = {}
65
+ local sub = observableList:ObserveItemsBrio():Subscribe(function(value)
66
+ table.insert(seen, value)
57
67
  end)
68
+ observableList:Add("a")
58
69
 
59
- it("should fire off events for all keys", function()
60
- local seen = {}
61
- local sub = observableList:ObserveItemsBrio():Subscribe(function(value)
62
- table.insert(seen, value)
63
- end)
64
- observableList:Add("a")
70
+ local value = seen[4]:GetValue()
71
+ expect(#seen).toEqual(4)
72
+ expect(value).toEqual("a")
73
+ expect(seen[4]:IsDead()).toEqual(false)
65
74
 
66
- expect(#seen).to.equal(4)
67
- expect(seen[4]:GetValue()).to.equal("a")
68
- expect(seen[4]:IsDead()).to.equal(false)
75
+ sub:Destroy()
69
76
 
70
- sub:Destroy()
77
+ expect(#seen).toEqual(4)
78
+ expect(seen[4]:IsDead()).toEqual(true)
79
+ end)
71
80
 
72
- expect(#seen).to.equal(4)
73
- expect(seen[4]:IsDead()).to.equal(true)
81
+ it("it should be able to observe a specific key", function()
82
+ local seen = {}
83
+ local sub = observableList:ObserveAtIndex(1):Subscribe(function(value)
84
+ table.insert(seen, value)
74
85
  end)
75
86
 
76
- it("it should be able to observe a specific key", function()
77
- local seen = {}
78
- local sub = observableList:ObserveAtIndex(1):Subscribe(function(value)
79
- table.insert(seen, value)
80
- end)
87
+ local originalList = observableList:GetList()
88
+ expect(originalList[1]).toEqual("c")
81
89
 
82
- local originalList = observableList:GetList()
83
- expect(originalList[1]).to.equal("c")
90
+ observableList:InsertAt("dragon", 1)
84
91
 
85
- observableList:InsertAt("dragon", 1)
92
+ sub:Destroy()
86
93
 
87
- sub:Destroy()
94
+ expect(#seen).toEqual(2)
95
+ expect(seen[1]).toEqual("c")
96
+ expect(seen[2]).toEqual("dragon")
97
+ end)
88
98
 
89
- expect(#seen).to.equal(2)
90
- expect(seen[1]).to.equal("c")
91
- expect(seen[2]).to.equal("dragon")
99
+ it("it should be able to observe a specific negative key", function()
100
+ local seen = {}
101
+ local sub = observableList:ObserveAtIndex(-1):Subscribe(function(value)
102
+ table.insert(seen, value)
92
103
  end)
93
104
 
94
- it("it should be able to observe a specific negative key", function()
95
- local seen = {}
96
- local sub = observableList:ObserveAtIndex(-1):Subscribe(function(value)
97
- table.insert(seen, value)
98
- end)
105
+ local originalList = observableList:GetList()
106
+ expect(originalList[#originalList]).toEqual("a")
99
107
 
100
- local originalList = observableList:GetList()
101
- expect(originalList[#originalList]).to.equal("a")
108
+ observableList:Add("fire")
102
109
 
103
- observableList:Add("fire")
110
+ sub:Destroy()
104
111
 
105
- sub:Destroy()
112
+ expect(#seen).toEqual(2)
113
+ expect(seen[1]).toEqual("a")
114
+ expect(seen[2]).toEqual("fire")
115
+ end)
106
116
 
107
- expect(#seen).to.equal(2)
108
- expect(seen[1]).to.equal("a")
109
- expect(seen[2]).to.equal("fire")
117
+ it("should fire off events on removal", function()
118
+ local seen = {}
119
+ local sub = observableList:ObserveIndex(2):Subscribe(function(value)
120
+ table.insert(seen, value)
110
121
  end)
122
+ observableList:RemoveAt(1)
111
123
 
112
- it("should fire off events on removal", function()
113
- local seen = {}
114
- local sub = observableList:ObserveIndex(2):Subscribe(function(value)
115
- table.insert(seen, value)
116
- end)
117
- observableList:RemoveAt(1)
124
+ sub:Destroy()
118
125
 
119
- sub:Destroy()
120
-
121
- expect(#seen).to.equal(2)
122
- expect(seen[1]).to.equal(2)
123
- expect(seen[2]).to.equal(1)
124
- end)
126
+ expect(#seen).toEqual(2)
127
+ expect(seen[1]).toEqual(2)
128
+ expect(seen[2]).toEqual(1)
129
+ end)
125
130
 
126
- it("should clean up", function()
127
- observableList:Destroy()
128
- end)
131
+ it("should clean up", function()
132
+ observableList:Destroy()
129
133
  end)
130
- end
134
+ end)
@@ -4,71 +4,74 @@
4
4
 
5
5
  local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
6
6
 
7
+ local Jest = require("Jest")
7
8
  local ObservableMap = require("ObservableMap")
8
9
 
9
- return function()
10
- describe("ObservableMap.new()", function()
11
- local observableMap = ObservableMap.new()
10
+ local describe = Jest.Globals.describe
11
+ local expect = Jest.Globals.expect
12
+ local it = Jest.Globals.it
12
13
 
13
- it("should return nil for unset values", function()
14
- expect(observableMap:Get("a")).to.equal(nil)
15
- end)
14
+ describe("ObservableMap.new()", function()
15
+ local observableMap = ObservableMap.new()
16
16
 
17
- it("should allow setting a value", function()
18
- expect(observableMap:GetCount()).to.equal(0)
17
+ it("should return nil for unset values", function()
18
+ expect(observableMap:Get("a")).toEqual(nil)
19
+ end)
19
20
 
20
- observableMap:Set("a", "Hello World")
21
+ it("should allow setting a value", function()
22
+ expect(observableMap:GetCount()).toEqual(0)
21
23
 
22
- expect(observableMap:Get("a")).to.equal("Hello World")
23
- expect(observableMap:GetCount()).to.equal(1)
24
- end)
24
+ observableMap:Set("a", "Hello World")
25
25
 
26
- it("should overwrite values", function()
27
- expect(observableMap:Get("a")).to.equal("Hello World")
26
+ expect(observableMap:Get("a")).toEqual("Hello World")
27
+ expect(observableMap:GetCount()).toEqual(1)
28
+ end)
28
29
 
29
- observableMap:Set("a", "Hello World 2")
30
+ it("should overwrite values", function()
31
+ expect(observableMap:Get("a")).toEqual("Hello World")
30
32
 
31
- expect(observableMap:Get("a")).to.equal("Hello World 2")
32
- end)
33
+ observableMap:Set("a", "Hello World 2")
34
+
35
+ expect(observableMap:Get("a")).toEqual("Hello World 2")
36
+ end)
33
37
 
34
- it("should allow false as a key", function()
35
- expect(observableMap:Get(false)).to.equal(nil)
36
- observableMap:Set(false, "Hello")
37
- expect(observableMap:Get(false)).to.equal("Hello")
38
+ it("should allow false as a key", function()
39
+ expect(observableMap:Get(false)).toEqual(nil)
40
+ observableMap:Set(false, "Hello")
41
+ expect(observableMap:Get(false)).toEqual("Hello")
42
+ end)
43
+
44
+ it("should fire off events for a specific key", function()
45
+ local seen = {}
46
+ local sub = observableMap:ObserveValueForKey("c"):Subscribe(function(value)
47
+ table.insert(seen, value)
38
48
  end)
49
+ observableMap:Set("c", "Hello")
39
50
 
40
- it("should fire off events for a specific key", function()
41
- local seen = {}
42
- local sub = observableMap:ObserveValueForKey("c"):Subscribe(function(value)
43
- table.insert(seen, value)
44
- end)
45
- observableMap:Set("c", "Hello")
51
+ sub:Destroy()
46
52
 
47
- sub:Destroy()
53
+ expect(#seen).toEqual(1)
54
+ expect(seen[1]).toEqual("Hello")
55
+ end)
48
56
 
49
- expect(#seen).to.equal(1)
50
- expect(seen[1]).to.equal("Hello")
57
+ it("should fire off events for all keys", function()
58
+ local seen = {}
59
+ local sub = observableMap:ObserveValuesBrio():Subscribe(function(value)
60
+ table.insert(seen, value)
51
61
  end)
62
+ observableMap:Set("d", "Hello")
52
63
 
53
- it("should fire off events for all keys", function()
54
- local seen = {}
55
- local sub = observableMap:ObserveValuesBrio():Subscribe(function(value)
56
- table.insert(seen, value)
57
- end)
58
- observableMap:Set("d", "Hello")
59
-
60
- expect(#seen).to.equal(4)
61
- expect(seen[4]:GetValue()).to.equal("Hello")
62
- expect(seen[4]:IsDead()).to.equal(false)
64
+ expect(#seen).toEqual(4)
65
+ expect(seen[4]:GetValue()).toEqual("Hello")
66
+ expect(seen[4]:IsDead()).toEqual(false)
63
67
 
64
- sub:Destroy()
68
+ sub:Destroy()
65
69
 
66
- expect(#seen).to.equal(4)
67
- expect(seen[4]:IsDead()).to.equal(true)
68
- end)
70
+ expect(#seen).toEqual(4)
71
+ expect(seen[4]:IsDead()).toEqual(true)
72
+ end)
69
73
 
70
- it("should clean up", function()
71
- observableMap:Destroy()
72
- end)
74
+ it("should clean up", function()
75
+ observableMap:Destroy()
73
76
  end)
74
- end
77
+ end)
@@ -4,21 +4,24 @@
4
4
 
5
5
  local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
6
6
 
7
+ local Jest = require("Jest")
7
8
  local ObservableMapList = require("ObservableMapList")
8
9
 
9
- return function()
10
- describe("ObservableMapList.new()", function()
11
- local observableMapList = ObservableMapList.new()
10
+ local describe = Jest.Globals.describe
11
+ local expect = Jest.Globals.expect
12
+ local it = Jest.Globals.it
12
13
 
13
- it("should return nil for unset values", function()
14
- expect(observableMapList:GetAtListIndex("dragon", 1)).to.equal(nil)
15
- end)
14
+ describe("ObservableMapList.new()", function()
15
+ local observableMapList = ObservableMapList.new()
16
16
 
17
- it("should allow additions", function()
18
- observableMapList:Add("hello", "dragon")
19
- expect(observableMapList:GetAtListIndex("dragon", 1)).to.equal("hello")
20
- expect(observableMapList:GetAtListIndex("dragon", -1)).to.equal("hello")
21
- expect(observableMapList:GetAtListIndex("fire", 1)).to.equal(nil)
22
- end)
17
+ it("should return nil for unset values", function()
18
+ expect(observableMapList:GetAtListIndex("dragon", 1)).toEqual(nil)
23
19
  end)
24
- end
20
+
21
+ it("should allow additions", function()
22
+ observableMapList:Push("hello", "dragon")
23
+ expect(observableMapList:GetAtListIndex("hello", 1)).toEqual("dragon")
24
+ expect(observableMapList:GetAtListIndex("hello", -1)).toEqual("dragon")
25
+ expect(observableMapList:GetAtListIndex("fire", 1)).toEqual(nil)
26
+ end)
27
+ end)
@@ -4,53 +4,56 @@
4
4
 
5
5
  local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
6
6
 
7
+ local Jest = require("Jest")
7
8
  local ObservableSortedList = require("ObservableSortedList")
8
9
  local Rx = require("Rx")
9
10
  local StepUtils = require("StepUtils")
10
11
 
11
- return function()
12
- describe("ObservableSortedList.new()", function()
13
- local observableSortedList = ObservableSortedList.new()
12
+ local describe = Jest.Globals.describe
13
+ local expect = Jest.Globals.expect
14
+ local it = Jest.Globals.it
14
15
 
15
- it("should return nil for unset values", function()
16
- expect(observableSortedList:Get(1)).to.equal(nil)
17
- end)
16
+ describe("ObservableSortedList.new()", function()
17
+ local observableSortedList = ObservableSortedList.new()
18
18
 
19
- it("should allow inserting an value", function()
20
- expect(observableSortedList:GetCount()).to.equal(0)
19
+ it("should return nil for unset values", function()
20
+ expect(observableSortedList:Get(1)).toEqual(nil)
21
+ end)
22
+
23
+ it("should allow inserting an value", function()
24
+ expect(observableSortedList:GetCount()).toEqual(0)
21
25
 
22
- observableSortedList:Add("b", Rx.of("b"))
26
+ observableSortedList:Add("b", Rx.of("b"))
23
27
 
24
- StepUtils.deferWait()
28
+ StepUtils.deferWait()
25
29
 
26
- expect(observableSortedList:Get(1)).to.equal("b")
27
- expect(observableSortedList:GetCount()).to.equal(1)
28
- end)
30
+ expect(observableSortedList:Get(1)).toEqual("b")
31
+ expect(observableSortedList:GetCount()).toEqual(1)
32
+ end)
29
33
 
30
- it("should sort the items", function()
31
- expect(observableSortedList:GetCount()).to.equal(1)
34
+ it("should sort the items", function()
35
+ expect(observableSortedList:GetCount()).toEqual(1)
32
36
 
33
- observableSortedList:Add("a", Rx.of("a"))
37
+ observableSortedList:Add("a", Rx.of("a"))
34
38
 
35
- StepUtils.deferWait()
39
+ StepUtils.deferWait()
36
40
 
37
- expect(observableSortedList:Get(1)).to.equal("a")
38
- expect(observableSortedList:Get(2)).to.equal("b")
39
- expect(observableSortedList:GetCount()).to.equal(2)
40
- end)
41
+ expect(observableSortedList:Get(1)).toEqual("a")
42
+ expect(observableSortedList:Get(2)).toEqual("b")
43
+ expect(observableSortedList:GetCount()).toEqual(2)
44
+ end)
41
45
 
42
- it("should add in order if number is the same", function()
43
- observableSortedList = ObservableSortedList.new()
44
- observableSortedList:Add("a", Rx.of(0))
45
- observableSortedList:Add("b", Rx.of(0))
46
- observableSortedList:Add("c", Rx.of(0))
46
+ it("should add in order if number is the same", function()
47
+ observableSortedList = ObservableSortedList.new()
48
+ observableSortedList:Add("a", Rx.of(0))
49
+ observableSortedList:Add("b", Rx.of(0))
50
+ observableSortedList:Add("c", Rx.of(0))
47
51
 
48
- StepUtils.deferWait()
52
+ StepUtils.deferWait()
49
53
 
50
- expect(observableSortedList:Get(1)).to.equal("a")
51
- expect(observableSortedList:Get(2)).to.equal("b")
52
- expect(observableSortedList:Get(3)).to.equal("c")
53
- expect(observableSortedList:GetCount()).to.equal(3)
54
- end)
54
+ expect(observableSortedList:Get(1)).toEqual("a")
55
+ expect(observableSortedList:Get(2)).toEqual("b")
56
+ expect(observableSortedList:Get(3)).toEqual("c")
57
+ expect(observableSortedList:GetCount()).toEqual(3)
55
58
  end)
56
- end
59
+ end)