[英]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.我正在使用来自 udemy 的课程,它被称为“完整的 NFT Web 开发课程 - 从零到专家”,我在 174 处遇到错误,我正在制作一个名为“Kryptobird.js”的智能合约并出现错误. 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':这是我运行命令“truffle test”时遇到的错误:
1- It
should not be capital "I" 1-
It
不应该是大写的“I”
it("deploys successfully", async () => {
2- also this might cause error artifacts.require('./KryptoBird')
2-这也可能导致错误
artifacts.require('./KryptoBird')
it should not be the relative path.它不应该是相对路径。 it should be the name of the contract
它应该是合同的名称
const KryptoBird = artifacts.require("KryptoBird");
3- 3-
const { assert } = require("chai");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.