diff --git a/test/base/test.ts b/test/base/test.ts index 81a0311..1a1cc57 100644 --- a/test/base/test.ts +++ b/test/base/test.ts @@ -244,8 +244,32 @@ describe('Garden smoke test', () => { assert.deepStrictEqual(result, golden); }); + it('a nested seed can define its own id', async() => { + const garden = loadTestGarden([]); + //We can't just do a manually typed SeedPacket because its type doesn't + //explicitly allow nesting due to the error descrbied in + //makeNestedSeedData, issue #16. + const packet = seedPacket.parse({ + version: 0, + seeds: { + '': { + 'type': 'log', + 'value': { + 'id': 'foo', + 'type': 'log', + 'value': true + } + } + } + }); + garden.plantSeedPacket('test/base/foo.json', packet); + const seed = await garden.seed('foo'); + const result = await seed.grow(); + const golden = true; + assert.deepStrictEqual(result, golden); + }); + - //TODO: a named inner value doesn't pass. }); describe('expandSeedPacket tests', () => {