jest.js.template 788 B

123456789101112131415161718192021222324
  1. const boltSdk = require("@magicblock-labs/bolt-sdk");
  2. const {{
  3. InitializeNewWorld,
  4. }} = boltSdk;
  5. const anchor = require("@coral-xyz/anchor");
  6. describe("{}", () => {{
  7. // Configure the client to use the local cluster.
  8. const provider = anchor.AnchorProvider.env();
  9. anchor.setProvider(provider);
  10. // Constants used to test the program.
  11. let worldPda: PublicKey;
  12. it("InitializeNewWorld", async () => {{
  13. const initNewWorld = await InitializeNewWorld({{
  14. payer: provider.wallet.publicKey,
  15. connection: provider.connection,
  16. }});
  17. const txSign = await provider.sendAndConfirm(initNewWorld.transaction);
  18. worldPda = initNewWorld.worldPda;
  19. console.log(`Initialized a new world (ID=${{worldPda}}). Initialization signature: ${{txSign}}`);
  20. }});
  21. }});