test.ts 616 B

1234567891011121314151617181920212223
  1. import * as anchor from "@project-serum/anchor";
  2. import { CustomInstructionData } from "../target/types/custom_instruction_data";
  3. describe("custom-instruction-data", () => {
  4. const provider = anchor.AnchorProvider.env();
  5. anchor.setProvider(provider);
  6. const program = anchor.workspace.CustomInstructionData as anchor.Program<CustomInstructionData>;
  7. it("Go to the park!", async () => {
  8. // Again, Anchor makes it super simple.
  9. //
  10. await program.methods.goToPark("Jimmy", 3)
  11. .accounts({})
  12. .rpc();
  13. await program.methods.goToPark("Mary", 10)
  14. .accounts({})
  15. .rpc();
  16. });
  17. });