test.ts 592 B

12345678910111213141516171819202122
  1. import * as anchor from "@project-serum/anchor";
  2. import { HelloSolana } from "../target/types/hello_solana";
  3. describe("hello-solana", () => {
  4. // Configure the Anchor provider & load the program IDL
  5. // The IDL gives you a typescript module
  6. //
  7. const provider = anchor.AnchorProvider.env();
  8. anchor.setProvider(provider);
  9. const program = anchor.workspace.HelloSolana as anchor.Program<HelloSolana>;
  10. it("Say hello!", async () => {
  11. // Just run Anchor's IDL method to build a transaction!
  12. //
  13. await program.methods.hello()
  14. .accounts({})
  15. .rpc();
  16. });
  17. });