jazz-tools 0.8.15 → 0.8.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. package/CHANGELOG.md +276 -269
  2. package/dist/native/coValues/account.js +3 -6
  3. package/dist/native/coValues/account.js.map +1 -1
  4. package/dist/native/coValues/coList.js +3 -7
  5. package/dist/native/coValues/coList.js.map +1 -1
  6. package/dist/native/coValues/coMap.js +8 -14
  7. package/dist/native/coValues/coMap.js.map +1 -1
  8. package/dist/native/coValues/coStream.js +7 -12
  9. package/dist/native/coValues/coStream.js.map +1 -1
  10. package/dist/native/coValues/deepLoading.js +6 -3
  11. package/dist/native/coValues/deepLoading.js.map +1 -1
  12. package/dist/native/coValues/extensions/imageDef.js.map +1 -1
  13. package/dist/native/coValues/group.js +3 -6
  14. package/dist/native/coValues/group.js.map +1 -1
  15. package/dist/native/coValues/interfaces.js +4 -3
  16. package/dist/native/coValues/interfaces.js.map +1 -1
  17. package/dist/native/exports.js +3 -9
  18. package/dist/native/exports.js.map +1 -1
  19. package/dist/native/implementation/createContext.js +1 -2
  20. package/dist/native/implementation/createContext.js.map +1 -1
  21. package/dist/native/implementation/devtoolsFormatters.js +5 -25
  22. package/dist/native/implementation/devtoolsFormatters.js.map +1 -1
  23. package/dist/native/implementation/refs.js +1 -2
  24. package/dist/native/implementation/refs.js.map +1 -1
  25. package/dist/native/implementation/schema.js +1 -1
  26. package/dist/native/implementation/schema.js.map +1 -1
  27. package/dist/native/implementation/subscriptionScope.js +2 -4
  28. package/dist/native/implementation/subscriptionScope.js.map +1 -1
  29. package/dist/native/index.native.js +1 -1
  30. package/dist/native/index.native.js.map +1 -1
  31. package/dist/native/lib/cache.js.map +1 -1
  32. package/dist/native/lib/cache.test.js +1 -1
  33. package/dist/native/lib/cache.test.js.map +1 -1
  34. package/dist/web/coValues/account.js +3 -6
  35. package/dist/web/coValues/account.js.map +1 -1
  36. package/dist/web/coValues/coList.js +3 -7
  37. package/dist/web/coValues/coList.js.map +1 -1
  38. package/dist/web/coValues/coMap.js +8 -14
  39. package/dist/web/coValues/coMap.js.map +1 -1
  40. package/dist/web/coValues/coStream.js +7 -12
  41. package/dist/web/coValues/coStream.js.map +1 -1
  42. package/dist/web/coValues/deepLoading.js +6 -3
  43. package/dist/web/coValues/deepLoading.js.map +1 -1
  44. package/dist/web/coValues/extensions/imageDef.js.map +1 -1
  45. package/dist/web/coValues/group.js +3 -6
  46. package/dist/web/coValues/group.js.map +1 -1
  47. package/dist/web/coValues/interfaces.js +4 -3
  48. package/dist/web/coValues/interfaces.js.map +1 -1
  49. package/dist/web/exports.js +3 -9
  50. package/dist/web/exports.js.map +1 -1
  51. package/dist/web/implementation/createContext.js +1 -2
  52. package/dist/web/implementation/createContext.js.map +1 -1
  53. package/dist/web/implementation/devtoolsFormatters.js +5 -25
  54. package/dist/web/implementation/devtoolsFormatters.js.map +1 -1
  55. package/dist/web/implementation/refs.js +1 -2
  56. package/dist/web/implementation/refs.js.map +1 -1
  57. package/dist/web/implementation/schema.js +1 -1
  58. package/dist/web/implementation/schema.js.map +1 -1
  59. package/dist/web/implementation/subscriptionScope.js +2 -4
  60. package/dist/web/implementation/subscriptionScope.js.map +1 -1
  61. package/dist/web/lib/cache.js.map +1 -1
  62. package/dist/web/lib/cache.test.js +1 -1
  63. package/dist/web/lib/cache.test.js.map +1 -1
  64. package/package.json +5 -9
  65. package/src/coValues/account.ts +330 -339
  66. package/src/coValues/coList.ts +474 -495
  67. package/src/coValues/coMap.ts +584 -604
  68. package/src/coValues/coStream.ts +624 -650
  69. package/src/coValues/deepLoading.ts +184 -200
  70. package/src/coValues/extensions/imageDef.ts +44 -44
  71. package/src/coValues/group.ts +196 -210
  72. package/src/coValues/interfaces.ts +197 -199
  73. package/src/exports.ts +38 -26
  74. package/src/implementation/createContext.ts +206 -213
  75. package/src/implementation/devtoolsFormatters.ts +80 -100
  76. package/src/implementation/refs.ts +127 -139
  77. package/src/implementation/schema.ts +124 -128
  78. package/src/implementation/subscriptionScope.ts +111 -121
  79. package/src/index.native.ts +3 -3
  80. package/src/lib/cache.test.ts +48 -48
  81. package/src/lib/cache.ts +9 -9
  82. package/src/tests/coList.test.ts +264 -283
  83. package/src/tests/coMap.test.ts +741 -761
  84. package/src/tests/coStream.test.ts +405 -438
  85. package/src/tests/deepLoading.test.ts +251 -256
  86. package/src/tests/groupsAndAccounts.test.ts +70 -74
  87. package/src/tests/schema.test.ts +198 -198
  88. package/src/tests/subscribe.test.ts +312 -299
  89. package/tsconfig.json +2 -4
  90. package/tsconfig.native.json +4 -10
  91. package/tsconfig.web.json +4 -10
  92. package/.eslintrc.cjs +0 -24
  93. package/.prettierrc.js +0 -9
@@ -1,311 +1,306 @@
1
1
  const Crypto = await WasmCrypto.create();
2
- import { expect, describe, test, expectTypeOf } from "vitest";
3
2
  import { connectedPeers } from "cojson/src/streamUtils.ts";
3
+ import { describe, expect, expectTypeOf, test } from "vitest";
4
4
  import {
5
- Account,
6
- CoList,
7
- CoMap,
8
- CoStream,
9
- SessionID,
10
- WasmCrypto,
11
- co,
12
- Profile,
13
- isControlledAccount,
14
- ID,
15
- createJazzContext,
16
- fixedCredentialsAuth,
5
+ Account,
6
+ CoList,
7
+ CoMap,
8
+ CoStream,
9
+ ID,
10
+ Profile,
11
+ SessionID,
12
+ WasmCrypto,
13
+ co,
14
+ createJazzContext,
15
+ fixedCredentialsAuth,
16
+ isControlledAccount,
17
17
  } from "../index.web.js";
18
18
  import { randomSessionProvider } from "../internal.js";
19
19
 
20
20
  class TestMap extends CoMap {
21
- list = co.ref(TestList);
22
- optionalRef = co.ref(InnermostMap, { optional: true });
21
+ list = co.ref(TestList);
22
+ optionalRef = co.ref(InnermostMap, { optional: true });
23
23
  }
24
24
 
25
25
  class TestList extends CoList.Of(co.ref(() => InnerMap)) {}
26
26
 
27
27
  class InnerMap extends CoMap {
28
- stream = co.ref(TestStream);
28
+ stream = co.ref(TestStream);
29
29
  }
30
30
 
31
31
  class TestStream extends CoStream.Of(co.ref(() => InnermostMap)) {}
32
32
 
33
33
  class InnermostMap extends CoMap {
34
- value = co.string;
34
+ value = co.string;
35
35
  }
36
36
 
37
37
  describe("Deep loading with depth arg", async () => {
38
- const me = await Account.create({
39
- creationProps: { name: "Hermes Puggington" },
40
- crypto: Crypto,
41
- });
38
+ const me = await Account.create({
39
+ creationProps: { name: "Hermes Puggington" },
40
+ crypto: Crypto,
41
+ });
42
42
 
43
- const [initialAsPeer, secondPeer] = connectedPeers("initial", "second", {
44
- peer1role: "server",
45
- peer2role: "client",
46
- });
43
+ const [initialAsPeer, secondPeer] = connectedPeers("initial", "second", {
44
+ peer1role: "server",
45
+ peer2role: "client",
46
+ });
47
47
 
48
- if (!isControlledAccount(me)) {
49
- throw "me is not a controlled account";
50
- }
51
- me._raw.core.node.syncManager.addPeer(secondPeer);
52
- const { account: meOnSecondPeer } = await createJazzContext({
53
- auth: fixedCredentialsAuth({
54
- accountID: me.id,
55
- secret: me._raw.agentSecret,
56
- }),
57
- sessionProvider: randomSessionProvider,
58
- peersToLoadFrom: [initialAsPeer],
59
- crypto: Crypto,
60
- });
48
+ if (!isControlledAccount(me)) {
49
+ throw "me is not a controlled account";
50
+ }
51
+ me._raw.core.node.syncManager.addPeer(secondPeer);
52
+ const { account: meOnSecondPeer } = await createJazzContext({
53
+ auth: fixedCredentialsAuth({
54
+ accountID: me.id,
55
+ secret: me._raw.agentSecret,
56
+ }),
57
+ sessionProvider: randomSessionProvider,
58
+ peersToLoadFrom: [initialAsPeer],
59
+ crypto: Crypto,
60
+ });
61
61
 
62
- test("loading a deeply nested object will wait until all required refs are loaded", async () => {
63
- const ownership = { owner: me };
64
- const map = TestMap.create(
65
- {
66
- list: TestList.create(
67
- [
68
- InnerMap.create(
69
- {
70
- stream: TestStream.create(
71
- [
72
- InnermostMap.create(
73
- { value: "hello" },
74
- ownership,
75
- ),
76
- ],
77
- ownership,
78
- ),
79
- },
80
- ownership,
81
- ),
82
- ],
83
- ownership,
62
+ test("loading a deeply nested object will wait until all required refs are loaded", async () => {
63
+ const ownership = { owner: me };
64
+ const map = TestMap.create(
65
+ {
66
+ list: TestList.create(
67
+ [
68
+ InnerMap.create(
69
+ {
70
+ stream: TestStream.create(
71
+ [InnermostMap.create({ value: "hello" }, ownership)],
72
+ ownership,
84
73
  ),
85
- },
86
- ownership,
87
- );
88
-
89
- const map1 = await TestMap.load(map.id, meOnSecondPeer, {});
90
- expectTypeOf(map1).toEqualTypeOf<TestMap | undefined>();
91
- if (map1 === undefined) {
92
- throw new Error("map1 is undefined");
93
- }
94
- expect(map1.list).toBe(null);
74
+ },
75
+ ownership,
76
+ ),
77
+ ],
78
+ ownership,
79
+ ),
80
+ },
81
+ ownership,
82
+ );
95
83
 
96
- const map2 = await TestMap.load(map.id, meOnSecondPeer, { list: [] });
97
- expectTypeOf(map2).toEqualTypeOf<
98
- | (TestMap & {
99
- list: TestList;
100
- })
101
- | undefined
102
- >();
103
- if (map2 === undefined) {
104
- throw new Error("map2 is undefined");
105
- }
106
- expect(map2.list).not.toBe(null);
107
- expect(map2.list[0]).toBe(null);
84
+ const map1 = await TestMap.load(map.id, meOnSecondPeer, {});
85
+ expectTypeOf(map1).toEqualTypeOf<TestMap | undefined>();
86
+ if (map1 === undefined) {
87
+ throw new Error("map1 is undefined");
88
+ }
89
+ expect(map1.list).toBe(null);
108
90
 
109
- const map3 = await TestMap.load(map.id, meOnSecondPeer, { list: [{}] });
110
- expectTypeOf(map3).toEqualTypeOf<
111
- | (TestMap & {
112
- list: TestList & InnerMap[];
113
- })
114
- | undefined
115
- >();
116
- if (map3 === undefined) {
117
- throw new Error("map3 is undefined");
118
- }
119
- expect(map3.list[0]).not.toBe(null);
120
- expect(map3.list[0]?.stream).toBe(null);
91
+ const map2 = await TestMap.load(map.id, meOnSecondPeer, { list: [] });
92
+ expectTypeOf(map2).toEqualTypeOf<
93
+ | (TestMap & {
94
+ list: TestList;
95
+ })
96
+ | undefined
97
+ >();
98
+ if (map2 === undefined) {
99
+ throw new Error("map2 is undefined");
100
+ }
101
+ expect(map2.list).not.toBe(null);
102
+ expect(map2.list[0]).toBe(null);
121
103
 
122
- const map3a = await TestMap.load(map.id, meOnSecondPeer, {
123
- optionalRef: {},
124
- });
125
- expectTypeOf(map3a).toEqualTypeOf<
126
- | (TestMap & {
127
- optionalRef: InnermostMap | undefined;
128
- })
129
- | undefined
130
- >();
104
+ const map3 = await TestMap.load(map.id, meOnSecondPeer, { list: [{}] });
105
+ expectTypeOf(map3).toEqualTypeOf<
106
+ | (TestMap & {
107
+ list: TestList & InnerMap[];
108
+ })
109
+ | undefined
110
+ >();
111
+ if (map3 === undefined) {
112
+ throw new Error("map3 is undefined");
113
+ }
114
+ expect(map3.list[0]).not.toBe(null);
115
+ expect(map3.list[0]?.stream).toBe(null);
131
116
 
132
- const map4 = await TestMap.load(map.id, meOnSecondPeer, {
133
- list: [{ stream: [] }],
134
- });
135
- expectTypeOf(map4).toEqualTypeOf<
136
- | (TestMap & {
137
- list: TestList & (InnerMap & { stream: TestStream })[];
138
- })
139
- | undefined
140
- >();
141
- if (map4 === undefined) {
142
- throw new Error("map4 is undefined");
143
- }
144
- expect(map4.list[0]?.stream).not.toBe(null);
145
- expect(map4.list[0]?.stream?.[me.id]).not.toBe(null);
146
- expect(map4.list[0]?.stream?.byMe?.value).toBe(null);
117
+ const map3a = await TestMap.load(map.id, meOnSecondPeer, {
118
+ optionalRef: {},
119
+ });
120
+ expectTypeOf(map3a).toEqualTypeOf<
121
+ | (TestMap & {
122
+ optionalRef: InnermostMap | undefined;
123
+ })
124
+ | undefined
125
+ >();
147
126
 
148
- const map5 = await TestMap.load(map.id, meOnSecondPeer, {
149
- list: [{ stream: [{}] }],
150
- });
151
- type ExpectedMap5 =
152
- | (TestMap & {
153
- list: TestList &
154
- (InnerMap & {
155
- stream: TestStream & {
156
- byMe?: { value: InnermostMap };
157
- inCurrentSession?: { value: InnermostMap };
158
- perSession: {
159
- [sessionID: SessionID]: {
160
- value: InnermostMap;
161
- };
162
- };
163
- } & {
164
- [key: ID<Account>]: { value: InnermostMap };
165
- };
166
- })[];
167
- })
168
- | undefined;
127
+ const map4 = await TestMap.load(map.id, meOnSecondPeer, {
128
+ list: [{ stream: [] }],
129
+ });
130
+ expectTypeOf(map4).toEqualTypeOf<
131
+ | (TestMap & {
132
+ list: TestList & (InnerMap & { stream: TestStream })[];
133
+ })
134
+ | undefined
135
+ >();
136
+ if (map4 === undefined) {
137
+ throw new Error("map4 is undefined");
138
+ }
139
+ expect(map4.list[0]?.stream).not.toBe(null);
140
+ expect(map4.list[0]?.stream?.[me.id]).not.toBe(null);
141
+ expect(map4.list[0]?.stream?.byMe?.value).toBe(null);
169
142
 
170
- expectTypeOf(map5).toEqualTypeOf<ExpectedMap5>();
171
- if (map5 === undefined) {
172
- throw new Error("map5 is undefined");
173
- }
174
- expect(map5.list[0]?.stream?.[me.id]?.value).not.toBe(null);
175
- expect(map5.list[0]?.stream?.byMe?.value).not.toBe(null);
143
+ const map5 = await TestMap.load(map.id, meOnSecondPeer, {
144
+ list: [{ stream: [{}] }],
176
145
  });
146
+ type ExpectedMap5 =
147
+ | (TestMap & {
148
+ list: TestList &
149
+ (InnerMap & {
150
+ stream: TestStream & {
151
+ byMe?: { value: InnermostMap };
152
+ inCurrentSession?: { value: InnermostMap };
153
+ perSession: {
154
+ [sessionID: SessionID]: {
155
+ value: InnermostMap;
156
+ };
157
+ };
158
+ } & {
159
+ [key: ID<Account>]: { value: InnermostMap };
160
+ };
161
+ })[];
162
+ })
163
+ | undefined;
164
+
165
+ expectTypeOf(map5).toEqualTypeOf<ExpectedMap5>();
166
+ if (map5 === undefined) {
167
+ throw new Error("map5 is undefined");
168
+ }
169
+ expect(map5.list[0]?.stream?.[me.id]?.value).not.toBe(null);
170
+ expect(map5.list[0]?.stream?.byMe?.value).not.toBe(null);
171
+ });
177
172
  });
178
173
 
179
174
  class CustomProfile extends Profile {
180
- stream = co.ref(TestStream);
175
+ stream = co.ref(TestStream);
181
176
  }
182
177
 
183
178
  class CustomAccount extends Account {
184
- profile = co.ref(CustomProfile);
185
- root = co.ref(TestMap);
179
+ profile = co.ref(CustomProfile);
180
+ root = co.ref(TestMap);
186
181
 
187
- async migrate(
188
- this: CustomAccount,
189
- creationProps?: { name: string } | undefined,
190
- ) {
191
- if (creationProps) {
192
- this.profile = CustomProfile.create(
193
- {
194
- name: creationProps.name,
195
- stream: TestStream.create([], { owner: this }),
196
- },
197
- { owner: this },
198
- );
199
- this.root = TestMap.create(
200
- { list: TestList.create([], { owner: this }) },
201
- { owner: this },
202
- );
203
- }
204
-
205
- const thisLoaded = await this.ensureLoaded({
206
- profile: { stream: [] },
207
- root: { list: [] },
208
- });
209
- expectTypeOf(thisLoaded).toEqualTypeOf<
210
- | (CustomAccount & {
211
- profile: CustomProfile & {
212
- stream: TestStream;
213
- };
214
- root: TestMap & {
215
- list: TestList;
216
- };
217
- })
218
- | undefined
219
- >();
182
+ async migrate(
183
+ this: CustomAccount,
184
+ creationProps?: { name: string } | undefined,
185
+ ) {
186
+ if (creationProps) {
187
+ this.profile = CustomProfile.create(
188
+ {
189
+ name: creationProps.name,
190
+ stream: TestStream.create([], { owner: this }),
191
+ },
192
+ { owner: this },
193
+ );
194
+ this.root = TestMap.create(
195
+ { list: TestList.create([], { owner: this }) },
196
+ { owner: this },
197
+ );
220
198
  }
199
+
200
+ const thisLoaded = await this.ensureLoaded({
201
+ profile: { stream: [] },
202
+ root: { list: [] },
203
+ });
204
+ expectTypeOf(thisLoaded).toEqualTypeOf<
205
+ | (CustomAccount & {
206
+ profile: CustomProfile & {
207
+ stream: TestStream;
208
+ };
209
+ root: TestMap & {
210
+ list: TestList;
211
+ };
212
+ })
213
+ | undefined
214
+ >();
215
+ }
221
216
  }
222
217
 
223
218
  test("Deep loading within account", async () => {
224
- const me = await CustomAccount.create({
225
- creationProps: { name: "Hermes Puggington" },
226
- crypto: Crypto,
227
- });
219
+ const me = await CustomAccount.create({
220
+ creationProps: { name: "Hermes Puggington" },
221
+ crypto: Crypto,
222
+ });
228
223
 
229
- const meLoaded = await me.ensureLoaded({
230
- profile: { stream: [] },
231
- root: { list: [] },
232
- });
233
- expectTypeOf(meLoaded).toEqualTypeOf<
234
- | (CustomAccount & {
235
- profile: CustomProfile & {
236
- stream: TestStream;
237
- };
238
- root: TestMap & {
239
- list: TestList;
240
- };
241
- })
242
- | undefined
243
- >();
244
- if (meLoaded === undefined) {
245
- throw new Error("meLoaded is undefined");
246
- }
247
- expect(meLoaded.profile.stream).not.toBe(null);
248
- expect(meLoaded.root.list).not.toBe(null);
224
+ const meLoaded = await me.ensureLoaded({
225
+ profile: { stream: [] },
226
+ root: { list: [] },
227
+ });
228
+ expectTypeOf(meLoaded).toEqualTypeOf<
229
+ | (CustomAccount & {
230
+ profile: CustomProfile & {
231
+ stream: TestStream;
232
+ };
233
+ root: TestMap & {
234
+ list: TestList;
235
+ };
236
+ })
237
+ | undefined
238
+ >();
239
+ if (meLoaded === undefined) {
240
+ throw new Error("meLoaded is undefined");
241
+ }
242
+ expect(meLoaded.profile.stream).not.toBe(null);
243
+ expect(meLoaded.root.list).not.toBe(null);
249
244
  });
250
245
 
251
246
  class RecordLike extends CoMap.Record(co.ref(TestMap)) {}
252
247
 
253
248
  test("Deep loading a record-like coMap", async () => {
254
- const me = await Account.create({
255
- creationProps: { name: "Hermes Puggington" },
256
- crypto: Crypto,
257
- });
249
+ const me = await Account.create({
250
+ creationProps: { name: "Hermes Puggington" },
251
+ crypto: Crypto,
252
+ });
258
253
 
259
- const [initialAsPeer, secondPeer] = connectedPeers("initial", "second", {
260
- peer1role: "server",
261
- peer2role: "client",
262
- });
254
+ const [initialAsPeer, secondPeer] = connectedPeers("initial", "second", {
255
+ peer1role: "server",
256
+ peer2role: "client",
257
+ });
263
258
 
264
- if (!isControlledAccount(me)) {
265
- throw "me is not a controlled account";
266
- }
259
+ if (!isControlledAccount(me)) {
260
+ throw "me is not a controlled account";
261
+ }
267
262
 
268
- me._raw.core.node.syncManager.addPeer(secondPeer);
269
- const { account: meOnSecondPeer } = await createJazzContext({
270
- auth: fixedCredentialsAuth({
271
- accountID: me.id,
272
- secret: me._raw.agentSecret,
273
- }),
274
- sessionProvider: randomSessionProvider,
275
- peersToLoadFrom: [initialAsPeer],
276
- crypto: Crypto,
277
- });
263
+ me._raw.core.node.syncManager.addPeer(secondPeer);
264
+ const { account: meOnSecondPeer } = await createJazzContext({
265
+ auth: fixedCredentialsAuth({
266
+ accountID: me.id,
267
+ secret: me._raw.agentSecret,
268
+ }),
269
+ sessionProvider: randomSessionProvider,
270
+ peersToLoadFrom: [initialAsPeer],
271
+ crypto: Crypto,
272
+ });
278
273
 
279
- const record = RecordLike.create(
280
- {
281
- key1: TestMap.create(
282
- { list: TestList.create([], { owner: me }) },
283
- { owner: me },
284
- ),
285
- key2: TestMap.create(
286
- { list: TestList.create([], { owner: me }) },
287
- { owner: me },
288
- ),
289
- },
274
+ const record = RecordLike.create(
275
+ {
276
+ key1: TestMap.create(
277
+ { list: TestList.create([], { owner: me }) },
290
278
  { owner: me },
291
- );
279
+ ),
280
+ key2: TestMap.create(
281
+ { list: TestList.create([], { owner: me }) },
282
+ { owner: me },
283
+ ),
284
+ },
285
+ { owner: me },
286
+ );
292
287
 
293
- const recordLoaded = await RecordLike.load(record.id, meOnSecondPeer, [
294
- { list: [{}] },
295
- ]);
296
- expectTypeOf(recordLoaded).toEqualTypeOf<
297
- | (RecordLike & {
298
- [key: string]: TestMap & {
299
- list: TestList & InnerMap[];
300
- };
301
- })
302
- | undefined
303
- >();
304
- if (recordLoaded === undefined) {
305
- throw new Error("recordLoaded is undefined");
306
- }
307
- expect(recordLoaded.key1?.list).not.toBe(null);
308
- expect(recordLoaded.key1?.list).not.toBe(undefined);
309
- expect(recordLoaded.key2?.list).not.toBe(null);
310
- expect(recordLoaded.key2?.list).not.toBe(undefined);
288
+ const recordLoaded = await RecordLike.load(record.id, meOnSecondPeer, [
289
+ { list: [{}] },
290
+ ]);
291
+ expectTypeOf(recordLoaded).toEqualTypeOf<
292
+ | (RecordLike & {
293
+ [key: string]: TestMap & {
294
+ list: TestList & InnerMap[];
295
+ };
296
+ })
297
+ | undefined
298
+ >();
299
+ if (recordLoaded === undefined) {
300
+ throw new Error("recordLoaded is undefined");
301
+ }
302
+ expect(recordLoaded.key1?.list).not.toBe(null);
303
+ expect(recordLoaded.key1?.list).not.toBe(undefined);
304
+ expect(recordLoaded.key2?.list).not.toBe(null);
305
+ expect(recordLoaded.key2?.list).not.toBe(undefined);
311
306
  });