-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added test for WhitelistingManager contract - downgraded chai js version (chaijs/chai#1561) - downgraded @types/js-yalm version to 4.5.0 to allow commonjs typescript config compatibility
- Loading branch information
Showing
4 changed files
with
8,930 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ethers } from "hardhat"; | ||
|
||
const { expect } = require('chai'); | ||
const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); | ||
|
||
describe("WhitelistingManager", function () { | ||
async function deployContractFixture() { | ||
const [deployer, initialOwner] = await ethers.getSigners(); | ||
const WhitelistingManager = await ethers.getContractFactory("WhitelistingManager"); | ||
const whitelistingManager = await WhitelistingManager.deploy(initialOwner.address); | ||
await whitelistingManager.waitForDeployment(); | ||
|
||
return { deployer, initialOwner, whitelistingManager }; | ||
} | ||
|
||
describe("Ownership", function () { | ||
it("should set the initial owner correctly", async function () { | ||
const { initialOwner, whitelistingManager } = await loadFixture(deployContractFixture); | ||
expect(await whitelistingManager.owner()).to.equal(initialOwner.address); | ||
}); | ||
|
||
it("should not set the deployer as the owner", async function () { | ||
const { deployer, whitelistingManager } = await loadFixture(deployContractFixture); | ||
expect(await whitelistingManager.owner()).to.not.equal(deployer.address); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.