Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

an error in truffle test with "It" statement

I am using a course, from udemy, it is called "The Complete NFT Web Development Course – Zero To Expert" and I got an error, at 174, I am making a smart contract, called ‘Kryptobird.js’ and got an error.
if theres anything wrong with the code, please help me

const assert = require('chai')

const KryptoBird = artifacts.require('./KryptoBird')

// check for chai
require('chai')
.use(require('chai-as-promised'))
.should()
contract('KryptoBird', (accounts) => {
let contract


describe('deployment', async() => {
    It('deploys successfuly', async() => {
        contract = await KryptoBird.deployed()
        const address = contract.address;
        assert.notEqual(address, '')
        assert.notEqual(address, null)
        assert.notEqual(address, undefined)
        assert.notEqual(address, 0x0)
    })
}) 
})

and this is the error I’m getting when I run the command ‘truffle test’ :

error message

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

1- It should not be capital "I"

it("deploys successfully", async () => {

2- also this might cause error artifacts.require('./KryptoBird')

it should not be the relative path. it should be the name of the contract

const KryptoBird = artifacts.require("KryptoBird");

3-

 const { assert } = require("chai");
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading