Add mocha, chai, and test for Contribution

This commit is contained in:
Râu Cao 2022-08-23 10:41:46 +01:00
parent 1521e272f9
commit 59bda71f97
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
4 changed files with 701 additions and 133 deletions

View File

@ -1 +1,2 @@
/scripts/
/test/

811
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -39,11 +39,13 @@
},
"homepage": "https://github.com/67P/kredits-contracts#readme",
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@openzeppelin/contracts-upgradeable": "^4.3.2",
"@openzeppelin/hardhat-upgrades": "^1.10.0",
"async-each-series": "^1.1.0",
"chai": "^4.3.6",
"cli-table": "^0.3.1",
"colors": "^1.0.3",
"eslint": "^8.14.0",
@ -57,6 +59,7 @@
"hardhat-deploy": "^0.11.4",
"hardhat-deploy-ethers": "^0.3.0-beta.10",
"homedir": "^0.6.0",
"mocha": "^10.0.0",
"promptly": "^3.0.3",
"solhint": "^3.3.7",
"truffle-hdwallet-provider": "^1.0.17",

19
test/Contribution.js Normal file
View File

@ -0,0 +1,19 @@
const { expect } = require("chai");
const { ethers, upgrades } = require("hardhat");
let hardhatContribution;
describe("Contribution contract", function () {
describe("Deployment", function () {
before(async function () {
// const [owner] = await ethers.getSigners();
const Contribution = await ethers.getContractFactory("Contribution");
hardhatContribution = await upgrades.deployProxy(Contribution, [40321]);
});
it("sets the veto confirmation period", async function () {
expect(await hardhatContribution.blocksToWait()).to.equal(40321);
});
});
});