Skip to content

Commit

Permalink
Add test to cover case with 0 arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxStalker committed Sep 22, 2021
1 parent c1776f5 commit 7c1eb4a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,26 @@ describe("spaces in definitions", ()=>{
})

describe("interaction signatures", () => {
test("multi line transaction signature - no arguments", async () => {
const code = `
// this is some basic transaction we want to send
transaction {
prepare(){}
}
`;
const args = extractTransactionArguments(code);
expect(args.length).toBe(0);
});

test("multi line script signature", async () => {
const code = `
// this is some basic transaction we want to send
pub fun main ( ) : String { return "Hello" }
`;
const args = extractTransactionArguments(code);
expect(args.length).toBe(0);
});

test("multi line transaction signature", async () => {
const code = `
// this is some basic transaction we want to send
Expand Down

0 comments on commit 7c1eb4a

Please sign in to comment.