From 8b6e2d681ff85d5efe8427243b6c11ff185ef582 Mon Sep 17 00:00:00 2001 From: Salman Dabbakuti Date: Tue, 28 Sep 2021 03:35:39 +0530 Subject: [PATCH] updated: tests --- hardhat.config.js | 2 +- package.json | 1 + test/sample-test.js | 11 ++++------- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hardhat.config.js b/hardhat.config.js index 0934fb3..e6d4d56 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -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 diff --git a/package.json b/package.json index a96c7d9..0eb8de9 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/test/sample-test.js b/test/sample-test.js index 44e0fcb..29ec422 100644 --- a/test/sample-test.js +++ b/test/sample-test.js @@ -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!"); }); });