@agoric/swingset-liveslots 0.10.3-u19.1 → 0.10.3-u20.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/package.json +16 -16
- package/src/collectionManager.d.ts +1 -0
- package/src/collectionManager.d.ts.map +1 -1
- package/src/collectionManager.js +1 -0
- package/src/liveslots.js +2 -2
- package/src/message.d.ts +10 -6
- package/src/message.d.ts.map +1 -1
- package/src/message.js +7 -3
- package/src/types.d.ts +8 -3
- package/src/types.d.ts.map +1 -1
- package/src/types.js +6 -5
- package/src/virtualObjectManager.d.ts.map +1 -1
- package/src/virtualObjectManager.js +70 -14
- package/src/watchedPromises.d.ts.map +1 -1
- package/src/watchedPromises.js +10 -13
- package/test/gc-helpers.js +2 -2
- package/test/handled-promises.test.js +529 -163
- package/test/initial-vrefs.test.js +12 -18
- package/test/liveslots-helpers.d.ts +1 -0
- package/test/liveslots-helpers.d.ts.map +1 -1
- package/test/liveslots-helpers.js +1 -0
- package/test/liveslots-real-gc.test.js +2 -2
- package/test/liveslots.test.js +3 -3
- package/test/storeGC/lifecycle.test.js +13 -12
- package/test/util.d.ts +1 -1
- package/test/util.d.ts.map +1 -1
- package/test/util.js +2 -2
- package/test/virtual-objects/state-shape.test.js +312 -221
- package/test/virtual-objects/virtualObjectGC.test.js +37 -36
- package/test/virtual-objects/virtualObjectManager.test.js +41 -63
- package/test/vo-test-harness.test.js +13 -9
- package/tools/fakeVirtualSupport.d.ts.map +1 -1
- package/tools/setup-vat-data.d.ts.map +1 -1
- package/tools/setup-vat-data.js +0 -1
- package/tools/vo-test-harness.d.ts +31 -0
- package/tools/vo-test-harness.d.ts.map +1 -1
- package/tools/vo-test-harness.js +21 -0
- package/test/watch-promise.test.js +0 -42
|
@@ -1,2 +1,33 @@
|
|
|
1
1
|
export function runVOTest(t: any, prepare: any, makeTestObject: any, testTestObject: any): Promise<void>;
|
|
2
|
+
export function makeSpy(t: import("ava").ExecutionContext): {
|
|
3
|
+
fail: (msg: any) => void;
|
|
4
|
+
falsy: (check: any, msg: any) => void;
|
|
5
|
+
failureMessage: string;
|
|
6
|
+
falsyMessage: string;
|
|
7
|
+
context: unknown;
|
|
8
|
+
title: string;
|
|
9
|
+
passed: boolean;
|
|
10
|
+
log: import("ava").LogFn;
|
|
11
|
+
plan: import("ava").PlanFn;
|
|
12
|
+
teardown: import("ava").TeardownFn;
|
|
13
|
+
timeout: import("ava").TimeoutFn;
|
|
14
|
+
try: import("ava").TryFn<unknown>;
|
|
15
|
+
assert: import("ava").AssertAssertion;
|
|
16
|
+
deepEqual: import("ava").DeepEqualAssertion;
|
|
17
|
+
like: import("ava").LikeAssertion;
|
|
18
|
+
false: import("ava").FalseAssertion;
|
|
19
|
+
is: import("ava").IsAssertion;
|
|
20
|
+
not: import("ava").NotAssertion;
|
|
21
|
+
notDeepEqual: import("ava").NotDeepEqualAssertion;
|
|
22
|
+
notRegex: import("ava").NotRegexAssertion;
|
|
23
|
+
notThrows: import("ava").NotThrowsAssertion;
|
|
24
|
+
notThrowsAsync: import("ava").NotThrowsAsyncAssertion;
|
|
25
|
+
pass: import("ava").PassAssertion;
|
|
26
|
+
regex: import("ava").RegexAssertion;
|
|
27
|
+
snapshot: import("ava").SnapshotAssertion;
|
|
28
|
+
throws: import("ava").ThrowsAssertion;
|
|
29
|
+
throwsAsync: import("ava").ThrowsAsyncAssertion;
|
|
30
|
+
true: import("ava").TrueAssertion;
|
|
31
|
+
truthy: import("ava").TruthyAssertion;
|
|
32
|
+
};
|
|
2
33
|
//# sourceMappingURL=vo-test-harness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vo-test-harness.d.ts","sourceRoot":"","sources":["vo-test-harness.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vo-test-harness.d.ts","sourceRoot":"","sources":["vo-test-harness.js"],"names":[],"mappings":"AA8FA,yGAqEC;AAxJM,2BAFI,OAAO,KAAK,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxC"}
|
package/tools/vo-test-harness.js
CHANGED
|
@@ -5,6 +5,27 @@ import { setupTestLiveslots } from '../test/liveslots-helpers.js';
|
|
|
5
5
|
// is to to help verify that a VO can be garbage collected and then
|
|
6
6
|
// reloaded from persistent storage while maintaining functionality.
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* A spy wrapping Ava's t for tests that are testing the harness itself.
|
|
10
|
+
* @param {import('ava').ExecutionContext} t
|
|
11
|
+
*/
|
|
12
|
+
export const makeSpy = t => {
|
|
13
|
+
const tSpy = {
|
|
14
|
+
...t,
|
|
15
|
+
fail: msg => {
|
|
16
|
+
tSpy.failureMessage = msg;
|
|
17
|
+
},
|
|
18
|
+
// In Ava 6, assertions throw?
|
|
19
|
+
falsy: (check, msg) => {
|
|
20
|
+
if (!check) return;
|
|
21
|
+
tSpy.falsyMessage = msg;
|
|
22
|
+
},
|
|
23
|
+
failureMessage: '',
|
|
24
|
+
falsyMessage: '',
|
|
25
|
+
};
|
|
26
|
+
return tSpy;
|
|
27
|
+
};
|
|
28
|
+
|
|
8
29
|
// Testing VO swapping with runVOTest:
|
|
9
30
|
//
|
|
10
31
|
// Step 1: import the necessary harness paraphernalia
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
|
|
3
|
-
import { Far } from '@endo/marshal';
|
|
4
|
-
import { makePromiseKit } from '@endo/promise-kit';
|
|
5
|
-
import { setupTestLiveslots } from './liveslots-helpers.js';
|
|
6
|
-
|
|
7
|
-
const build = vatPowers => {
|
|
8
|
-
const { VatData } = vatPowers;
|
|
9
|
-
const { makeKindHandle, defineDurableKind, watchPromise } = VatData;
|
|
10
|
-
|
|
11
|
-
const kh = makeKindHandle('handler');
|
|
12
|
-
const init = () => ({});
|
|
13
|
-
const behavior = {
|
|
14
|
-
onFulfilled: _value => 0,
|
|
15
|
-
onRejected: _reason => 0,
|
|
16
|
-
};
|
|
17
|
-
const makeHandler = defineDurableKind(kh, init, behavior);
|
|
18
|
-
|
|
19
|
-
return Far('root', {
|
|
20
|
-
async run() {
|
|
21
|
-
const pr = makePromiseKit();
|
|
22
|
-
const handler = makeHandler();
|
|
23
|
-
watchPromise(pr.promise, handler);
|
|
24
|
-
pr.resolve('ignored');
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
test('watched local promises should not leak slotToVal entries', async t => {
|
|
30
|
-
const { dispatchMessage, testHooks } = await setupTestLiveslots(
|
|
31
|
-
t,
|
|
32
|
-
build,
|
|
33
|
-
'vatA',
|
|
34
|
-
);
|
|
35
|
-
const { slotToVal } = testHooks;
|
|
36
|
-
const initial = slotToVal.size;
|
|
37
|
-
|
|
38
|
-
await dispatchMessage('run');
|
|
39
|
-
t.is(slotToVal.size, initial);
|
|
40
|
-
await dispatchMessage('run');
|
|
41
|
-
t.is(slotToVal.size, initial);
|
|
42
|
-
});
|