简体   繁体   中英

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

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");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM