Skip to content

Commit

Permalink
test(cli): Fix failing cli tests (#2453)
Browse files Browse the repository at this point in the history
Closes: #2409
Refs: #2384

## Description

This PR updates the readme to properly document the `list` cli command
and fixes the failing tests


### Security Considerations

none
### Scaling Considerations

none
### Documentation Considerations

none
### Testing Considerations

none
### Compatibility Considerations

none
### Upgrade Considerations

none
  • Loading branch information
sirtimid committed Sep 20, 2024
1 parent f61b771 commit 7948a69
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions packages/cli/demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ and adopt the "doubler" object into our own store.
> endo inbox --as alice-agent
0. "HOST" sent "Please enjoy this @doubler."
> endo adopt --as alice-agent 0 doubler
> endo list --as alice-agent
> endo list alice-agent
doubler
> endo dismiss --as alice-agent 0
```
Expand All @@ -230,7 +230,7 @@ Then, alice adopts "counter", giving it their own name, "redoubler".
> endo inbox --as alice-agent
1. "HOST" sent "Please enjoy this @counter."
> endo adopt --as alice-agent 1 counter --name redoubler
> endo list --as alice-agent
> endo list alice-agent
redoubler
> endo dismiss --as alice-agent 1
```
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/test/demo/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test.serial(
),
);

test.serial.failing(
test.serial(
'sending-messages',
makeSectionTest(
$({ cwd: 'demo' }),
Expand All @@ -49,7 +49,7 @@ test.serial.failing(
),
);

test.serial.failing(
test.serial(
'names-in-transit',
makeSectionTest(
$({ cwd: 'demo' }),
Expand All @@ -62,7 +62,7 @@ test.serial.failing(
),
);

test.serial.failing(
test.serial(
'mailboxes-are-symmetric',
makeSectionTest(
$({ cwd: 'demo' }),
Expand Down
9 changes: 6 additions & 3 deletions packages/cli/test/demo/mailboxes-are-symmetric.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ export const section = async (execa, testLine) => {
execa`endo send HOST --as alice-agent ${'This is the @doubler you sent me.'}`,
);
await testLine(execa`endo inbox`, {
stdout: /^0\. "alice" sent "This is the @doubler you sent me\."/,
stdout: /3\. "alice" sent "This is the @doubler you sent me\."/,
});
await testLine(execa`endo adopt 3 doubler doubler-from-alice`);
await testLine(execa`endo dismiss 3`);
await testLine(execa`endo inbox`, {
stdout: /^(?!3\. "alice" sent "This is the @doubler you sent me\.").*/,
});
await testLine(execa`endo adopt 0 doubler doubler-from-alice`);
await testLine(execa`endo dismiss 0`);
};
4 changes: 2 additions & 2 deletions packages/cli/test/demo/names-in-transit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const section = async (execa, testLine) => {
stdout: /^1\. "HOST" sent "Please enjoy this @counter\."/,
});
await testLine(execa`endo adopt --as alice-agent 1 counter --name redoubler`);
await testLine(execa`endo list --as alice-agent`, {
stdout: 'redoubler',
await testLine(execa`endo list alice-agent`, {
stdout: /redoubler/,
});
await testLine(execa`endo dismiss --as alice-agent 1`);
};
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/test/demo/sending-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const section = async (execa, testLine) => {
stdout: /^0\. "HOST" sent "Please enjoy this @doubler\."/,
});
await testLine(execa`endo adopt --as alice-agent 0 doubler`);
await testLine(execa`endo list --as alice-agent`, {
stdout: 'doubler',
await testLine(execa`endo list alice-agent`, {
stdout: /doubler/,
});
await testLine(execa`endo dismiss --as alice-agent 0`);
};
Expand All @@ -22,7 +22,7 @@ export const context = {
setup: async execa => {
await execa`endo mkguest alice alice-agent`;
await execa`endo send alice ${'Please enjoy this @doubler.'}`;
await execa`endo adopt alice-agent 0 doubler`;
await execa`endo adopt --as alice-agent 0 doubler`;
await execa`endo dismiss --as alice-agent 0`;
},
};

0 comments on commit 7948a69

Please sign in to comment.