codex-contracts-eth/test/Periods.test.js
Arnaud bfa5a78b4f
Verify than secondsPerPeriod cannot be zero (#211)
* Assert than secondsPerPeriod cannot be zero
* Apply custom error
2025-01-24 09:22:21 +01:00

17 lines
587 B
JavaScript

const { expect } = require("chai")
const { ethers } = require("hardhat")
describe("Periods", function () {
it("should revert when secondsPerPeriod is 0", async function () {
const PeriodsContract = await ethers.getContractFactory("Periods")
await expect(PeriodsContract.deploy(0)).to.be.revertedWith(
"Periods_InvalidSecondsPerPeriod"
)
})
it("should not revert when secondsPerPeriod more than 0", async function () {
const PeriodsContract = await ethers.getContractFactory("Periods")
await expect(PeriodsContract.deploy(10)).not.to.be.reverted
})
})