Skip to content

Commit b89809f

Browse files
committed
stubbed out second test (short, short)
1 parent 2e7b9e9 commit b89809f

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

src/tools/tests/recipe2plan-test.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import {Manifest} from '../../runtime/manifest.js';
1212
import {StorageKeyRecipeResolver} from '../recipe2plan.js';
1313
import {assert} from '../../platform/chai-node.js';
14+
import {assertThrowsAsync} from '../../testing/test-util.js';
1415

1516
describe('recipe2plan', () => {
1617
it('Long + Long: If ReadingRecipe is long running, it is a valid use case', async () => {
@@ -46,9 +47,37 @@ describe('recipe2plan', () => {
4647
for await (const it of resolver.resolve()) {
4748
assert.isTrue(it.isResolved());
4849
}
50+
});
51+
it('Short + Short: If WritingRecipe is short lived, it is not valid', async () => {
52+
const manifest = await Manifest.parse(`\
53+
particle Reader
54+
data: reads Thing {name: Text}
55+
56+
// TODO(alxr): Resolve these types later
57+
// particle Writer
58+
// data: writes Product Thing {name: Text, price: Number}
59+
60+
particle Writer
61+
data: writes Thing {name: Text}
62+
63+
recipe WritingRecipe
64+
thing: create persistent 'my-handle-id'
65+
Writer
66+
data: writes thing
67+
68+
recipe ReadingRecipe
69+
data: map 'my-handle-id'
70+
Reader
71+
data: reads data`);
4972

73+
await assertThrowsAsync(async () => {
74+
const resolver = new StorageKeyRecipeResolver(manifest);
75+
// @ts-ignore
76+
for await (const it of resolver.resolve()) {
77+
continue;
78+
}
79+
})
5080
});
51-
it.skip('Short + Short: If WritingRecipe is short lived, it is not valid', () => {});
5281
it.skip('Short + Long: If WritingRecipe is short lived and Reading is long lived, it is not valid', () => {});
5382
it.skip('Invalid Type: If Reader reads {name: Text, age: Number} it is not valid', () => {});
5483
it.skip('No arc id: If arcId of WritingRecipe is not there, it is not valid', () => {});

0 commit comments

Comments
 (0)