Skip to content

Commit

Permalink
updated: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Salmandabbakuti committed Sep 27, 2021
1 parent 4ab8141 commit 8b6e2d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
},
polygonTest: {
url: "https://rpc-mumbai.maticvigil.com/", // rpc providers: polygon, infura, alchemy
accounts: ['']
accounts: []
},
polygonMain: {
url: "https://rpc-mainnet.maticvigil.com", // rpc providers: infura,polygon, alchemy
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@nomiclabs/hardhat-web3": "^2.0.0",
"chai": "^4.3.4",
"ethers": "^5.4.7",
"hardhat": "^2.6.4",
"web3": "^1.5.3"
Expand Down
11 changes: 4 additions & 7 deletions test/sample-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ const { ethers } = require("hardhat");

describe("Greeter", function () {
it("Should return the new greeting once it's changed", async function () {
const Greeter = await ethers.getContractFactory("Greeter");
const Greeter = await ethers.getContractFactory("greeter");
const greeter = await Greeter.deploy("Hello, world!");
await greeter.deployed();

expect(await greeter.greet()).to.equal("Hello, world!");

expect(await greeter.getGreeting()).to.equal("Hello, world!");
const setGreetingTx = await greeter.setGreeting("Hola, mundo!");

// wait until the transaction is mined
// wait for the transaction to be mined
await setGreetingTx.wait();

expect(await greeter.greet()).to.equal("Hola, mundo!");
expect(await greeter.getGreeting()).to.equal("Hola, mundo!");
});
});

0 comments on commit 8b6e2d6

Please sign in to comment.