@@ -28,15 +28,15 @@ describe('recipe2plan', () => {
28
28
29
29
@trigger
30
30
launch startup
31
- arcId myArcId
31
+ arcId writeArcId
32
32
recipe WritingRecipe
33
33
thing: create persistent 'my-handle-id'
34
34
Writer
35
35
data: writes thing
36
36
37
37
@trigger
38
38
launch startup
39
- arcId otherArcId
39
+ arcId readArcId
40
40
recipe ReadingRecipe
41
41
data: map 'my-handle-id'
42
42
Reader
@@ -53,9 +53,31 @@ describe('recipe2plan', () => {
53
53
particle Reader
54
54
data: reads Thing {name: Text}
55
55
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}
59
81
60
82
particle Writer
61
83
data: writes Thing {name: Text}
@@ -65,6 +87,9 @@ describe('recipe2plan', () => {
65
87
Writer
66
88
data: writes thing
67
89
90
+ @trigger
91
+ launch startup
92
+ arcId readArcId
68
93
recipe ReadingRecipe
69
94
data: map 'my-handle-id'
70
95
Reader
@@ -76,9 +101,8 @@ describe('recipe2plan', () => {
76
101
for await ( const it of resolver . resolve ( ) ) {
77
102
continue ;
78
103
}
79
- } )
104
+ } ) ;
80
105
} ) ;
81
- it . skip ( 'Short + Long: If WritingRecipe is short lived and Reading is long lived, it is not valid' , ( ) => { } ) ;
82
106
it . skip ( 'Invalid Type: If Reader reads {name: Text, age: Number} it is not valid' , ( ) => { } ) ;
83
107
it . skip ( 'No arc id: If arcId of WritingRecipe is not there, it is not valid' , ( ) => { } ) ;
84
108
it . skip ( 'No handleId: If id of handle in WritingRecipe is not provided, it is not valid' , ( ) => { } ) ;
0 commit comments