测试Solidity合约的Truffle JS代码的基本框架:

文章
50 0

const ContractName = artifacts.require('ContractName');

contract('ContractName', (accounts) => {
let instance;

before(async () => {

instance = await ContractName.deployed();

});

it('should do something', async () => {

// 在这里编写测试代码

});

it('should do something else', async () => {

// 在这里编写测试代码

});
});

最后更新 2023-04-23
评论 ( 0 )
OωO
隐私评论