-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathtest.ts
More file actions
27 lines (21 loc) · 945 Bytes
/
test.ts
File metadata and controls
27 lines (21 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import * as anchor from "@coral-xyz/anchor";
import { Program } from "@coral-xyz/anchor";
import { Example } from "../target/types/example";
import { assert } from "chai";
describe("multiple-scripts", () => {
// Configure the client to use the local cluster.
anchor.setProvider(anchor.AnchorProvider.env());
const program = anchor.workspace.Example as Program<Example>;
it("Initializes successfully", async () => {
// Call the initialize instruction
const tx = await program.methods.initialize().rpc();
console.log("Transaction signature:", tx);
assert.ok(tx, "Transaction should have a signature");
});
it("Can be called multiple times", async () => {
// Call initialize again to demonstrate it can be called multiple times
const tx = await program.methods.initialize().rpc();
console.log("Second transaction signature:", tx);
assert.ok(tx, "Second transaction should also succeed");
});
});