Skip to content

Commit

Permalink
fix: repair rebase on #1964
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jan 18, 2024
1 parent d7987e5 commit 7556f21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/exo/test/test-amplify-heap-class-kits.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// modeled on test-revoke-heap-classes.js
// modeled on test-heap-classes.js

// eslint-disable-next-line import/order
import { test } from './prepare-test-env-ava.js';
Expand Down
27 changes: 4 additions & 23 deletions packages/exo/test/test-live-instance-heap-class-kits.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// modeled on test-revoke-heap-classes.js
// modeled on test-heap-classes.js

// eslint-disable-next-line import/order
import { test } from './prepare-test-env-ava.js';
Expand All @@ -15,8 +15,7 @@ const DownCounterI = M.interface('DownCounter', {
decr: M.call().optional(M.gte(0)).returns(M.number()),
});

test('test revoke defineExoClass', t => {
let revoke;
test('test isLiveInstance defineExoClass', t => {
let isLiveInstance;
const makeUpCounter = defineExoClass(
'UpCounter',
Expand All @@ -31,9 +30,6 @@ test('test revoke defineExoClass', t => {
},
},
{
receiveRevoker(r) {
revoke = r;
},
receiveInstanceTester(i) {
isLiveInstance = i;
},
Expand All @@ -52,12 +48,9 @@ test('test revoke defineExoClass', t => {
message:
'facetName can only be used with an exo class kit: "UpCounter" has no facet "up"',
});
t.is(revoke(upCounter), true);
t.is(isLiveInstance(upCounter), false);
});

test('test amplify defineExoClassKit', t => {
let revoke;
test('test isLiveInstance defineExoClassKit', t => {
let isLiveInstance;
const makeCounterKit = defineExoClassKit(
'Counter',
Expand All @@ -81,9 +74,6 @@ test('test amplify defineExoClassKit', t => {
},
},
{
receiveRevoker(r) {
revoke = r;
},
receiveInstanceTester(i) {
isLiveInstance = i;
},
Expand All @@ -96,21 +86,12 @@ test('test amplify defineExoClassKit', t => {
message: 'exo class kit "Counter" has no facet named "foo"',
});

const { up: upCounter, down: downCounter } = makeCounterKit(3);
const { up: upCounter } = makeCounterKit(3);

t.is(isLiveInstance(upCounter), true);
t.is(isLiveInstance(upCounter, 'up'), true);
t.is(isLiveInstance(upCounter, 'down'), false);
t.throws(() => isLiveInstance(upCounter, 'foo'), {
message: 'exo class kit "Counter" has no facet named "foo"',
});

t.is(revoke(upCounter), true);

t.is(isLiveInstance(upCounter), false);
t.is(isLiveInstance(upCounter, 'up'), false);
t.is(isLiveInstance(upCounter, 'down'), false);
t.is(isLiveInstance(downCounter), true);
t.is(isLiveInstance(downCounter, 'up'), false);
t.is(isLiveInstance(downCounter, 'down'), true);
});

0 comments on commit 7556f21

Please sign in to comment.