Skip to content

Instantly share code, notes, and snippets.

@aindrajaya
Last active January 30, 2022 21:30
Show Gist options
  • Save aindrajaya/a684e8cf56bd00651f462c842878f3b4 to your computer and use it in GitHub Desktop.
Save aindrajaya/a684e8cf56bd00651f462c842878f3b4 to your computer and use it in GitHub Desktop.
Mastering Blockchain Development part 2
import "@nomiclabs/hardhat-waffle";
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
//Change the code below
solidity: 0.8.10;
}
import _ from "@nomiclabs/hardhat-waffle";
import { ethers } from "hardhat";
import { expect } from "chai";
describe("Hello test", () => {
it("should be get the hello world string", async function(){
//1. Setup, just call the name of your contract (contract name), not the file name.
const OurContract = await ethers.getContractFactory("HelloContract");
//2. Deploy our contract using deploy and deployed function from nomiclabs/hardhat-ethers
const DeployContract = await OurContract.deploy();
await DeployContract.deployed();
//3. Call our functions to test
expect(await DeployContract.hello()).to.equal("Hello, world from Web 3");
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment