Skip to content

Commit

Permalink
test: after plugins can return values
Browse files Browse the repository at this point in the history
  • Loading branch information
albertolerda committed Sep 19, 2023
1 parent d729101 commit e24860e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/core/test/slangroom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,17 @@ Then I print 'foo'
const zout = await slang.execute(contract);
t.is(zout.result['foo'] as string, 'bar');
});

test('after-plugins can return values', async (t) => {
const before = new AfterPlugin(() => {
return { foo: "bar" };
});
const slang = new Slangroom(before);
const contract = `Rule unknown ignore
Given nothing
Then done
Then I need an ignored statement
`;
const zout = await slang.execute(contract);
t.is(zout.result['foo'] as string, 'bar');
});

0 comments on commit e24860e

Please sign in to comment.