Skip to content

Commit

Permalink
Add a test for function/call.
Browse files Browse the repository at this point in the history
Part of #20.
  • Loading branch information
jkomoros committed Jul 29, 2023
1 parent f3a2fe8 commit f3dc5dc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/base/a_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,28 @@
"type": "fetch",
"resource": "https://raw.githubusercontent.com/jkomoros/prompt-garden/main/seeds/example-basic.json",
"method": "POST"
},
"function-test": {
"type": "function",
"arguments": [
"arg:message"
],
"block": {
"type": "log",
"value": {
"type": "var",
"name": "arg:message"
}
}
},
"call-test": {
"type": "call",
"function": {
"seed": "function-test"
},
"arguments": {
"arg:message": "Test"
}
}
}
}
8 changes: 8 additions & 0 deletions test/base/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,14 @@ Suffix`;
assert.deepStrictEqual(actual,golden);
});

it('function/call test', async () => {
const garden = loadTestGarden();
const seed = await garden.seed('call-test');
const actual = await seed.grow();
const golden = 'Test';
assert.deepStrictEqual(actual, golden);
});

});

describe('expandSeedPacket tests', () => {
Expand Down

0 comments on commit f3dc5dc

Please sign in to comment.