Untitled
Never
const { expect } = require("chai"); const { ethers } = require("hardhat"); describe("Testing NFT", function () { let nftContract; it("Deployment Testing", async function () { const [owner] = await ethers.getSigners(); const NFT = await ethers.getContractFactory("NFT"); nftContract = await NFT.deploy(); expect(nftContract.runner.addres).to.equal(owner.addres) }) it("Should get name", async function () { expect(await nftContract.name()).to.equal("HashTag"); }) it("Should Mint NFT", async function () { await expect(nftContract.MintNFT("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266")) .to.emit(nftContract, "Transfer") .withArgs("0x0000000000000000000000000000000000000000", "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", 1) }) it("Check owner",async function() { const nftOwner = await nftContract.ownerOf(1); expect(nftOwner).to.equal("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"); }) it("Should revert", async function() { const [owner, otherAc] = await ethers.getSigners(); await expect(nftContract.connect(otherAc).changeTokenURI("other URI")).to.be.revertedWith("You're not authorized") }) })
Raw Text
-
Breaking news - Update 1 - 12/02/2023 03:34:50
1 min ago
-
Breaking news - Update 1 - 12/02/2023 03:34:28
2 min ago
-
Breaking news - Update 1 - 12/02/2023 03:28:43
7 min ago
-
Breaking news - Update 1 - 12/02/2023 03:27:37
9 min ago
-
Breaking news - Update 1 - 12/02/2023 03:26:22
9 min ago
-
Breaking news - Update 1 - 12/02/2023 03:20:42
16 min ago
-
Breaking news - Update 1 - 12/02/2023 03:20:06
16 min ago
-
Breaking news - Update 1 - 12/02/2023 03:14:08
18 min ago
-
Breaking news - Update 1 - 12/02/2023 03:17:18
19 min ago
-
Breaking news - Update 1 - 12/02/2023 03:13:19
23 min ago