test.ts 569 B

1234567891011121314151617
  1. import * as anchor from '@coral-xyz/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().accounts({}).rpc();
  14. });
  15. });