Skip to content

Commit 6df9388

Browse files
committed
updates to test, can't get two to fail
1 parent 282f8b4 commit 6df9388

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

src/tools/tests/recipe2plan-test.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ describe('recipe2plan', () => {
2828
2929
@trigger
3030
launch startup
31-
arcId myArcId
31+
arcId writeArcId
3232
recipe WritingRecipe
3333
thing: create persistent 'my-handle-id'
3434
Writer
3535
data: writes thing
3636
3737
@trigger
3838
launch startup
39-
arcId otherArcId
39+
arcId readArcId
4040
recipe ReadingRecipe
4141
data: map 'my-handle-id'
4242
Reader
@@ -53,9 +53,31 @@ describe('recipe2plan', () => {
5353
particle Reader
5454
data: reads Thing {name: Text}
5555
56-
// TODO(alxr): Resolve these types later
57-
// particle Writer
58-
// data: writes Product Thing {name: Text, price: Number}
56+
particle Writer
57+
data: writes Thing {name: Text}
58+
59+
recipe WritingRecipe
60+
thing: create persistent 'my-handle-id'
61+
Writer
62+
data: writes thing
63+
64+
recipe ReadingRecipe
65+
data: map 'my-handle-id'
66+
Reader
67+
data: reads data`);
68+
69+
const resolver = new StorageKeyRecipeResolver(manifest);
70+
await assertThrowsAsync(async () => {
71+
// @ts-ignore
72+
for await (const it of resolver.resolve()) {
73+
continue;
74+
}
75+
});
76+
});
77+
it('Short + Long: If WritingRecipe is short lived and Reading is long lived, it is not valid', async () => {
78+
const manifest = await Manifest.parse(`\
79+
particle Reader
80+
data: reads Thing {name: Text}
5981
6082
particle Writer
6183
data: writes Thing {name: Text}
@@ -65,6 +87,9 @@ describe('recipe2plan', () => {
6587
Writer
6688
data: writes thing
6789
90+
@trigger
91+
launch startup
92+
arcId readArcId
6893
recipe ReadingRecipe
6994
data: map 'my-handle-id'
7095
Reader
@@ -76,9 +101,8 @@ describe('recipe2plan', () => {
76101
for await (const it of resolver.resolve()) {
77102
continue;
78103
}
79-
})
104+
});
80105
});
81-
it.skip('Short + Long: If WritingRecipe is short lived and Reading is long lived, it is not valid', () => {});
82106
it.skip('Invalid Type: If Reader reads {name: Text, age: Number} it is not valid', () => {});
83107
it.skip('No arc id: If arcId of WritingRecipe is not there, it is not valid', () => {});
84108
it.skip('No handleId: If id of handle in WritingRecipe is not provided, it is not valid', () => {});

0 commit comments

Comments
 (0)