You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
845 B

3 years ago
import { expect } from "chai";
import { SmartContract } from "ton-contract-executor";
import { createCode, createData } from "../contracts/main";
import { randomAddress } from "./utils";
3 years ago
describe("Counter tests", () => {
let contract: SmartContract;
beforeEach(async () => {
contract = await SmartContract.fromCell(
createCode(),
createData({
ownerAddress: randomAddress(0, "seed1"),
counter: 17,
})
);
});
it("should run getter counter() and get counter value", async () => {
const call = await contract.invokeGetMethod("counter", []);
expect(call.result[0].toNumber()).to.equal(17);
});
it("should run getter meaning_of_life()", async () => {
const call = await contract.invokeGetMethod("meaning_of_life", []);
expect(call.result[0].toNumber()).to.equal(42);
});
3 years ago
});