Skip to content

Commit

Permalink
chore(testing): ensure eval outputs properly after evolving the ANT
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusofsparta committed Sep 25, 2024
1 parent c992742 commit 9d559b1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/evolve.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('aos Evolve', async () => {
);
}

it('should evolve the ant', async () => {
it('should evolve the ant and retain eval ability', async () => {
const srcCodeTxIdStub = ''.padEnd(43, '123-test');
const evolveResult = await handle({
Tags: [
Expand All @@ -42,6 +42,17 @@ describe('aos Evolve', async () => {
const state = JSON.parse(result.Messages[0].Data);
assert(state);
assert(state['Source-Code-TX-ID'] === srcCodeTxIdStub);

const evalResult = await handle(
{
Tags: [{ name: 'Action', value: 'Eval' }],
Data: 'Handlers.list',
},
evolveResult.Memory,
);

assert(evalResult.Output.data.output);
assert(evalResult.Output.data.output.includes('evolve'));
});

it('should not evolve the ant', async () => {
Expand Down

0 comments on commit 9d559b1

Please sign in to comment.