jazz-tools 0.7.0-alpha.0 → 0.7.0-alpha.11
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.cjs +8 -1
- package/.turbo/turbo-build.log +79 -9
- package/CHANGELOG.md +76 -0
- package/dist/coValues/account.js +171 -0
- package/dist/coValues/account.js.map +1 -0
- package/dist/coValues/coList.js +246 -0
- package/dist/coValues/coList.js.map +1 -0
- package/dist/coValues/coMap.js +235 -0
- package/dist/coValues/coMap.js.map +1 -0
- package/dist/coValues/coStream.js +263 -0
- package/dist/coValues/coStream.js.map +1 -0
- package/dist/coValues/extensions/imageDef.js +14 -11
- package/dist/coValues/extensions/imageDef.js.map +1 -1
- package/dist/coValues/group.js +71 -0
- package/dist/coValues/group.js.map +1 -0
- package/dist/coValues/interfaces.js +61 -0
- package/dist/coValues/interfaces.js.map +1 -0
- package/dist/implementation/errors.js.map +1 -0
- package/dist/implementation/inspect.js +2 -0
- package/dist/implementation/inspect.js.map +1 -0
- package/dist/{refs.js → implementation/refs.js} +16 -15
- package/dist/implementation/refs.js.map +1 -0
- package/dist/implementation/schema.js +41 -0
- package/dist/implementation/schema.js.map +1 -0
- package/dist/{subscriptionScope.js → implementation/subscriptionScope.js} +1 -1
- package/dist/implementation/subscriptionScope.js.map +1 -0
- package/dist/index.js +10 -29
- package/dist/index.js.map +1 -1
- package/dist/internal.js +13 -0
- package/dist/internal.js.map +1 -0
- package/dist/tests/coList.test.js +22 -22
- package/dist/tests/coList.test.js.map +1 -1
- package/dist/tests/coMap.test.js +140 -46
- package/dist/tests/coMap.test.js.map +1 -1
- package/dist/tests/coStream.test.js +55 -49
- package/dist/tests/coStream.test.js.map +1 -1
- package/package.json +11 -4
- package/src/coValues/account.ts +327 -0
- package/src/coValues/coList.ts +391 -0
- package/src/coValues/coMap.ts +413 -0
- package/src/coValues/coStream.ts +404 -0
- package/src/coValues/extensions/imageDef.ts +20 -16
- package/src/coValues/group.ts +139 -0
- package/src/coValues/interfaces.ts +218 -0
- package/src/implementation/inspect.ts +2 -0
- package/src/{refs.ts → implementation/refs.ts} +53 -39
- package/src/implementation/schema.ts +124 -0
- package/src/{subscriptionScope.ts → implementation/subscriptionScope.ts} +11 -13
- package/src/index.ts +14 -57
- package/src/internal.ts +15 -0
- package/src/tests/coList.test.ts +23 -25
- package/src/tests/coMap.test.ts +140 -53
- package/src/tests/coStream.test.ts +76 -68
- package/dist/coValueInterfaces.js +0 -8
- package/dist/coValueInterfaces.js.map +0 -1
- package/dist/coValues/account/account.js +0 -11
- package/dist/coValues/account/account.js.map +0 -1
- package/dist/coValues/account/accountOf.js +0 -150
- package/dist/coValues/account/accountOf.js.map +0 -1
- package/dist/coValues/account/migration.js +0 -4
- package/dist/coValues/account/migration.js.map +0 -1
- package/dist/coValues/coList/coList.js +0 -2
- package/dist/coValues/coList/coList.js.map +0 -1
- package/dist/coValues/coList/coListOf.js +0 -235
- package/dist/coValues/coList/coListOf.js.map +0 -1
- package/dist/coValues/coList/internalDocs.js +0 -2
- package/dist/coValues/coList/internalDocs.js.map +0 -1
- package/dist/coValues/coMap/coMap.js +0 -2
- package/dist/coValues/coMap/coMap.js.map +0 -1
- package/dist/coValues/coMap/coMapOf.js +0 -262
- package/dist/coValues/coMap/coMapOf.js.map +0 -1
- package/dist/coValues/coMap/internalDocs.js +0 -2
- package/dist/coValues/coMap/internalDocs.js.map +0 -1
- package/dist/coValues/coStream/coStream.js +0 -2
- package/dist/coValues/coStream/coStream.js.map +0 -1
- package/dist/coValues/coStream/coStreamOf.js +0 -244
- package/dist/coValues/coStream/coStreamOf.js.map +0 -1
- package/dist/coValues/construction.js +0 -34
- package/dist/coValues/construction.js.map +0 -1
- package/dist/coValues/group/group.js +0 -2
- package/dist/coValues/group/group.js.map +0 -1
- package/dist/coValues/group/groupOf.js +0 -109
- package/dist/coValues/group/groupOf.js.map +0 -1
- package/dist/coValues/resolution.js +0 -66
- package/dist/coValues/resolution.js.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/refs.js.map +0 -1
- package/dist/schemaHelpers.js +0 -14
- package/dist/schemaHelpers.js.map +0 -1
- package/dist/subscriptionScope.js.map +0 -1
- package/dist/tests/types.test.js +0 -33
- package/dist/tests/types.test.js.map +0 -1
- package/src/coValueInterfaces.ts +0 -105
- package/src/coValues/account/account.ts +0 -106
- package/src/coValues/account/accountOf.ts +0 -284
- package/src/coValues/account/migration.ts +0 -12
- package/src/coValues/coList/coList.ts +0 -57
- package/src/coValues/coList/coListOf.ts +0 -377
- package/src/coValues/coList/internalDocs.ts +0 -1
- package/src/coValues/coMap/coMap.ts +0 -110
- package/src/coValues/coMap/coMapOf.ts +0 -451
- package/src/coValues/coMap/internalDocs.ts +0 -1
- package/src/coValues/coStream/coStream.ts +0 -63
- package/src/coValues/coStream/coStreamOf.ts +0 -404
- package/src/coValues/construction.ts +0 -110
- package/src/coValues/group/group.ts +0 -27
- package/src/coValues/group/groupOf.ts +0 -183
- package/src/coValues/resolution.ts +0 -111
- package/src/schemaHelpers.ts +0 -72
- package/src/tests/types.test.ts +0 -37
- /package/dist/{errors.js → implementation/errors.js} +0 -0
- /package/src/{errors.ts → implementation/errors.ts} +0 -0
package/src/tests/coList.test.ts
CHANGED
@@ -4,7 +4,7 @@ import { webcrypto } from "node:crypto";
|
|
4
4
|
import { connectedPeers } from "cojson/src/streamUtils.js";
|
5
5
|
import { newRandomSessionID } from "cojson/src/coValueCore.js";
|
6
6
|
import { Effect, Queue } from "effect";
|
7
|
-
import {
|
7
|
+
import { Account, CoList, co, jazzReady } from "..";
|
8
8
|
|
9
9
|
if (!("crypto" in globalThis)) {
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -20,7 +20,7 @@ describe("Simple CoList operations", async () => {
|
|
20
20
|
name: "Hermes Puggington",
|
21
21
|
});
|
22
22
|
|
23
|
-
class TestList extends
|
23
|
+
class TestList extends CoList.Of(co.string) {}
|
24
24
|
|
25
25
|
const list = new TestList(["bread", "butter", "onion"], { owner: me });
|
26
26
|
|
@@ -97,32 +97,32 @@ describe("Simple CoList operations", async () => {
|
|
97
97
|
expect(list._raw.asArray()).toEqual(["butter", "onion"]);
|
98
98
|
});
|
99
99
|
|
100
|
-
test("splice", () => {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
});
|
100
|
+
// test("splice", () => {
|
101
|
+
// const list = new TestList(["bread", "butter", "onion"], {
|
102
|
+
// owner: me,
|
103
|
+
// });
|
104
|
+
// list.splice(1, 1, "salt", "pepper");
|
105
|
+
// expect(list.length).toBe(4);
|
106
|
+
// expect(list._raw.asArray()).toEqual([
|
107
|
+
// "bread",
|
108
|
+
// "salt",
|
109
|
+
// "pepper",
|
110
|
+
// "onion",
|
111
|
+
// ]);
|
112
|
+
// });
|
113
113
|
});
|
114
114
|
});
|
115
115
|
|
116
116
|
describe("CoList resolution", async () => {
|
117
|
-
class TwiceNestedList extends
|
117
|
+
class TwiceNestedList extends CoList.Of(co.string) {
|
118
118
|
joined() {
|
119
119
|
return this.join(",");
|
120
120
|
}
|
121
121
|
}
|
122
122
|
|
123
|
-
class NestedList extends
|
123
|
+
class NestedList extends CoList.Of(co.ref(TwiceNestedList)) {}
|
124
124
|
|
125
|
-
class TestList extends
|
125
|
+
class TestList extends CoList.Of(co.ref(NestedList)) {}
|
126
126
|
|
127
127
|
const initNodeAndList = async () => {
|
128
128
|
const me = await Account.create({
|
@@ -173,7 +173,7 @@ describe("CoList resolution", async () => {
|
|
173
173
|
|
174
174
|
const loadedList = await TestList.load(list.id, { as: meOnSecondPeer });
|
175
175
|
|
176
|
-
expect(loadedList?.[0]).toBe(
|
176
|
+
expect(loadedList?.[0]).toBe(null);
|
177
177
|
expect(loadedList?._refs[0]?.id).toEqual(list[0]!.id);
|
178
178
|
|
179
179
|
const loadedNestedList = await NestedList.load(list[0]!.id, {
|
@@ -181,7 +181,7 @@ describe("CoList resolution", async () => {
|
|
181
181
|
});
|
182
182
|
|
183
183
|
expect(loadedList?.[0]).toBeDefined();
|
184
|
-
expect(loadedList?.[0]?.[0]).
|
184
|
+
expect(loadedList?.[0]?.[0]).toBe(null);
|
185
185
|
expect(loadedList?.[0]?._refs[0]?.id).toEqual(list[0]![0]!.id);
|
186
186
|
expect(loadedList?._refs[0]?.value).toEqual(loadedNestedList);
|
187
187
|
|
@@ -194,9 +194,7 @@ describe("CoList resolution", async () => {
|
|
194
194
|
expect(loadedList?.[0]?.[0]?.[0]).toBe("a");
|
195
195
|
expect(loadedList?.[0]?.[0]?.joined()).toBe("a,b");
|
196
196
|
expect(loadedList?.[0]?._refs[0]?.id).toEqual(list[0]?.[0]?.id);
|
197
|
-
expect(loadedList?.[0]?._refs[0]?.value).toEqual(
|
198
|
-
loadedTwiceNestedList
|
199
|
-
);
|
197
|
+
expect(loadedList?.[0]?._refs[0]?.value).toEqual(loadedTwiceNestedList);
|
200
198
|
|
201
199
|
const otherNestedList = new NestedList(
|
202
200
|
[new TwiceNestedList(["e", "f"], { owner: meOnSecondPeer })],
|
@@ -241,11 +239,11 @@ describe("CoList resolution", async () => {
|
|
241
239
|
);
|
242
240
|
|
243
241
|
const update1 = yield* $(Queue.take(queue));
|
244
|
-
expect(update1?.[0]).
|
242
|
+
expect(update1?.[0]).toBe(null);
|
245
243
|
|
246
244
|
const update2 = yield* $(Queue.take(queue));
|
247
245
|
expect(update2?.[0]).toBeDefined();
|
248
|
-
expect(update2?.[0]?.[0]).
|
246
|
+
expect(update2?.[0]?.[0]).toBe(null);
|
249
247
|
|
250
248
|
const update3 = yield* $(Queue.take(queue));
|
251
249
|
expect(update3?.[0]?.[0]).toBeDefined();
|
package/src/tests/coMap.test.ts
CHANGED
@@ -4,7 +4,7 @@ import { webcrypto } from "node:crypto";
|
|
4
4
|
import { connectedPeers } from "cojson/src/streamUtils.js";
|
5
5
|
import { newRandomSessionID } from "cojson/src/coValueCore.js";
|
6
6
|
import { Effect, Queue } from "effect";
|
7
|
-
import {
|
7
|
+
import { Account, jazzReady, Encoders, CoMap, co } from "..";
|
8
8
|
|
9
9
|
if (!("crypto" in globalThis)) {
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -20,23 +20,25 @@ describe("Simple CoMap operations", async () => {
|
|
20
20
|
name: "Hermes Puggington",
|
21
21
|
});
|
22
22
|
|
23
|
-
class TestMap extends
|
24
|
-
color
|
25
|
-
|
26
|
-
birthday
|
27
|
-
name
|
28
|
-
|
23
|
+
class TestMap extends CoMap<TestMap> {
|
24
|
+
color = co.string;
|
25
|
+
_height = co.number;
|
26
|
+
birthday = co.encoded(Encoders.Date);
|
27
|
+
name? = co.string;
|
28
|
+
|
29
29
|
get roughColor() {
|
30
30
|
return this.color + "ish";
|
31
31
|
}
|
32
32
|
}
|
33
33
|
|
34
|
+
console.log("TestMap schema", TestMap.prototype._schema);
|
35
|
+
|
34
36
|
const birthday = new Date();
|
35
37
|
|
36
38
|
const map = new TestMap(
|
37
39
|
{
|
38
40
|
color: "red",
|
39
|
-
|
41
|
+
_height: 10,
|
40
42
|
birthday: birthday,
|
41
43
|
},
|
42
44
|
{ owner: me }
|
@@ -45,9 +47,15 @@ describe("Simple CoMap operations", async () => {
|
|
45
47
|
test("Construction", () => {
|
46
48
|
expect(map.color).toEqual("red");
|
47
49
|
expect(map.roughColor).toEqual("redish");
|
48
|
-
expect(map.
|
50
|
+
expect(map._height).toEqual(10);
|
49
51
|
expect(map.birthday).toEqual(birthday);
|
50
52
|
expect(map._raw.get("birthday")).toEqual(birthday.toISOString());
|
53
|
+
expect(Object.keys(map)).toEqual([
|
54
|
+
"color",
|
55
|
+
"_height",
|
56
|
+
"birthday",
|
57
|
+
"name",
|
58
|
+
]);
|
51
59
|
});
|
52
60
|
|
53
61
|
describe("Mutation", () => {
|
@@ -58,44 +66,123 @@ describe("Simple CoMap operations", async () => {
|
|
58
66
|
const newBirthday = new Date();
|
59
67
|
map.birthday = newBirthday;
|
60
68
|
expect(map.birthday).toEqual(newBirthday);
|
61
|
-
expect(map._raw.get("birthday")).toEqual(
|
62
|
-
newBirthday.toISOString()
|
63
|
-
);
|
69
|
+
expect(map._raw.get("birthday")).toEqual(newBirthday.toISOString());
|
64
70
|
|
65
|
-
Object.assign(map, { color: "green",
|
71
|
+
Object.assign(map, { color: "green", _height: 20 });
|
66
72
|
expect(map.color).toEqual("green");
|
67
73
|
expect(map._raw.get("color")).toEqual("green");
|
68
|
-
expect(map.
|
69
|
-
expect(map._raw.get("
|
74
|
+
expect(map._height).toEqual(20);
|
75
|
+
expect(map._raw.get("_height")).toEqual(20);
|
70
76
|
|
71
77
|
map.name = "Secret name";
|
72
78
|
expect(map.name).toEqual("Secret name");
|
73
|
-
|
79
|
+
map.name = undefined;
|
74
80
|
expect(map.name).toEqual(undefined);
|
75
81
|
});
|
76
82
|
});
|
83
|
+
|
84
|
+
class RecursiveMap extends CoMap<RecursiveMap> {
|
85
|
+
name = co.string;
|
86
|
+
next: co<RecursiveMap | null> = co.ref(RecursiveMap);
|
87
|
+
}
|
88
|
+
|
89
|
+
const recursiveMap = new RecursiveMap(
|
90
|
+
{
|
91
|
+
name: "first",
|
92
|
+
next: new RecursiveMap(
|
93
|
+
{
|
94
|
+
name: "second",
|
95
|
+
next: new RecursiveMap(
|
96
|
+
{
|
97
|
+
name: "third",
|
98
|
+
},
|
99
|
+
{ owner: me }
|
100
|
+
),
|
101
|
+
},
|
102
|
+
{ owner: me }
|
103
|
+
),
|
104
|
+
},
|
105
|
+
{ owner: me }
|
106
|
+
);
|
107
|
+
|
108
|
+
describe("Recursive CoMap", () => {
|
109
|
+
test("Construction", () => {
|
110
|
+
expect(recursiveMap.name).toEqual("first");
|
111
|
+
expect(recursiveMap.next?.name).toEqual("second");
|
112
|
+
expect(recursiveMap.next?.next?.name).toEqual("third");
|
113
|
+
});
|
114
|
+
});
|
115
|
+
|
116
|
+
class MapWithEnumOfMaps extends CoMap<MapWithEnumOfMaps> {
|
117
|
+
name = co.string;
|
118
|
+
child = co.ref<typeof ChildA | typeof ChildB>((raw) =>
|
119
|
+
raw.get("type") === "a" ? ChildA : ChildB
|
120
|
+
);
|
121
|
+
}
|
122
|
+
|
123
|
+
class ChildA extends CoMap<ChildA> {
|
124
|
+
type = co.literal("a");
|
125
|
+
value = co.number;
|
126
|
+
}
|
127
|
+
|
128
|
+
class ChildB extends CoMap<ChildB> {
|
129
|
+
type = co.literal("b");
|
130
|
+
value = co.string;
|
131
|
+
}
|
132
|
+
|
133
|
+
const mapWithEnum = new MapWithEnumOfMaps(
|
134
|
+
{
|
135
|
+
name: "enum",
|
136
|
+
child: new ChildA(
|
137
|
+
{
|
138
|
+
type: "a",
|
139
|
+
value: 5,
|
140
|
+
},
|
141
|
+
{ owner: me }
|
142
|
+
),
|
143
|
+
},
|
144
|
+
{ owner: me }
|
145
|
+
);
|
146
|
+
|
147
|
+
test("Enum of maps", () => {
|
148
|
+
expect(mapWithEnum.name).toEqual("enum");
|
149
|
+
expect(mapWithEnum.child?.type).toEqual("a");
|
150
|
+
expect(mapWithEnum.child?.value).toEqual(5);
|
151
|
+
expect(mapWithEnum.child?.id).toBeDefined();
|
152
|
+
});
|
153
|
+
|
154
|
+
class SuperClassMap extends CoMap<SuperClassMap> {
|
155
|
+
name = co.string;
|
156
|
+
}
|
157
|
+
|
158
|
+
class SubClassMap extends SuperClassMap {
|
159
|
+
name = co.literal("specificString")
|
160
|
+
value = co.number;
|
161
|
+
extra = co.ref(TestMap)
|
162
|
+
}
|
163
|
+
interface SubClassMap extends CoMap<SubClassMap> {}
|
77
164
|
});
|
78
165
|
|
79
166
|
describe("CoMap resolution", async () => {
|
80
|
-
class TwiceNestedMap extends
|
81
|
-
taste
|
82
|
-
}
|
83
|
-
|
84
|
-
class NestedMap extends
|
85
|
-
name
|
86
|
-
twiceNested
|
87
|
-
|
88
|
-
get
|
167
|
+
class TwiceNestedMap extends CoMap<TwiceNestedMap> {
|
168
|
+
taste = co.string;
|
169
|
+
}
|
170
|
+
|
171
|
+
class NestedMap extends CoMap<NestedMap> {
|
172
|
+
name = co.string;
|
173
|
+
twiceNested = co.ref(TwiceNestedMap);
|
174
|
+
|
175
|
+
get _fancyName() {
|
89
176
|
return "Sir " + this.name;
|
90
177
|
}
|
91
178
|
}
|
92
179
|
|
93
|
-
class TestMap extends
|
94
|
-
color
|
95
|
-
height
|
96
|
-
nested
|
97
|
-
|
98
|
-
get
|
180
|
+
class TestMap extends CoMap<TestMap> {
|
181
|
+
color = co.string;
|
182
|
+
height = co.number;
|
183
|
+
nested = co.ref(NestedMap);
|
184
|
+
|
185
|
+
get _roughColor() {
|
99
186
|
return this.color + "ish";
|
100
187
|
}
|
101
188
|
}
|
@@ -132,10 +219,10 @@ describe("CoMap resolution", async () => {
|
|
132
219
|
// const test: Schema.Schema.To<typeof NestedMap>
|
133
220
|
|
134
221
|
expect(map.color).toEqual("red");
|
135
|
-
expect(map.
|
222
|
+
expect(map._roughColor).toEqual("redish");
|
136
223
|
expect(map.height).toEqual(10);
|
137
224
|
expect(map.nested?.name).toEqual("nested");
|
138
|
-
expect(map.nested?.
|
225
|
+
expect(map.nested?._fancyName).toEqual("Sir nested");
|
139
226
|
expect(map.nested?.id).toBeDefined();
|
140
227
|
expect(map.nested?.twiceNested?.taste).toEqual("sour");
|
141
228
|
});
|
@@ -159,16 +246,16 @@ describe("CoMap resolution", async () => {
|
|
159
246
|
|
160
247
|
expect(loadedMap?.color).toEqual("red");
|
161
248
|
expect(loadedMap?.height).toEqual(10);
|
162
|
-
expect(loadedMap?.nested).toEqual(
|
249
|
+
expect(loadedMap?.nested).toEqual(null);
|
163
250
|
expect(loadedMap?._refs.nested?.id).toEqual(map.nested?.id);
|
164
|
-
expect(loadedMap?._refs.nested?.value).toEqual(
|
251
|
+
expect(loadedMap?._refs.nested?.value).toEqual(null);
|
165
252
|
|
166
253
|
const loadedNestedMap = await NestedMap.load(map.nested!.id, {
|
167
254
|
as: meOnSecondPeer,
|
168
255
|
});
|
169
256
|
|
170
257
|
expect(loadedMap?.nested?.name).toEqual("nested");
|
171
|
-
expect(loadedMap?.nested
|
258
|
+
expect(loadedMap?.nested?._fancyName).toEqual("Sir nested");
|
172
259
|
expect(loadedMap?._refs.nested?.value).toEqual(loadedNestedMap);
|
173
260
|
expect(loadedMap?.nested?.twiceNested?.taste).toEqual(undefined);
|
174
261
|
|
@@ -236,7 +323,7 @@ describe("CoMap resolution", async () => {
|
|
236
323
|
);
|
237
324
|
|
238
325
|
const update1 = yield* $(Queue.take(queue));
|
239
|
-
expect(update1.nested).toEqual(
|
326
|
+
expect(update1.nested).toEqual(null);
|
240
327
|
|
241
328
|
const update2 = yield* $(Queue.take(queue));
|
242
329
|
expect(update2.nested?.name).toEqual("nested");
|
@@ -287,10 +374,10 @@ describe("CoMap resolution", async () => {
|
|
287
374
|
);
|
288
375
|
});
|
289
376
|
|
290
|
-
class TestMapWithOptionalRef extends
|
291
|
-
color
|
292
|
-
nested
|
293
|
-
}
|
377
|
+
class TestMapWithOptionalRef extends CoMap<TestMapWithOptionalRef> {
|
378
|
+
color = co.string;
|
379
|
+
nested? = co.ref(NestedMap);
|
380
|
+
}
|
294
381
|
|
295
382
|
test("Construction with optional", async () => {
|
296
383
|
const me = await Account.create({
|
@@ -326,14 +413,14 @@ describe("CoMap resolution", async () => {
|
|
326
413
|
|
327
414
|
expect(mapWith.color).toEqual("red");
|
328
415
|
expect(mapWith.nested?.name).toEqual("wow!");
|
329
|
-
expect(mapWith.nested?.
|
416
|
+
expect(mapWith.nested?._fancyName).toEqual("Sir wow!");
|
330
417
|
expect(mapWith.nested?._raw).toBeDefined();
|
331
418
|
});
|
332
419
|
|
333
|
-
class TestRecord extends
|
334
|
-
|
335
|
-
|
336
|
-
|
420
|
+
class TestRecord extends CoMap<TestRecord> {
|
421
|
+
[co.items] = co.number;
|
422
|
+
}
|
423
|
+
interface TestRecord extends Record<string, number> {}
|
337
424
|
|
338
425
|
test("Construction with index signature", async () => {
|
339
426
|
const me = await Account.create({
|
@@ -342,16 +429,16 @@ describe("CoMap resolution", async () => {
|
|
342
429
|
|
343
430
|
const record = new TestRecord(
|
344
431
|
{
|
345
|
-
|
346
|
-
other:
|
432
|
+
height: 5,
|
433
|
+
other: 3,
|
347
434
|
},
|
348
435
|
{ owner: me }
|
349
436
|
);
|
350
437
|
|
351
|
-
expect(record.
|
352
|
-
expect(record._raw.get("
|
353
|
-
expect(record.other).toEqual(
|
354
|
-
expect(record._raw.get("other")).toEqual(
|
355
|
-
expect(Object.keys(record)).toEqual(["
|
438
|
+
expect(record.height).toEqual(5);
|
439
|
+
expect(record._raw.get("height")).toEqual(5);
|
440
|
+
expect(record.other).toEqual(3);
|
441
|
+
expect(record._raw.get("other")).toEqual(3);
|
442
|
+
expect(Object.keys(record)).toEqual(["height", "other"]);
|
356
443
|
});
|
357
444
|
});
|