Long story short my contract is not passing the deployment test using truffle, mocha, and chai.
I ran the code individually in the truffle console and it was returning an address just fine but it won't pass the test I wrote. I'm positive I wrote the mocha test well but I can't figure it out.
side note: running truffle test
from the truffle console causes node.js to throw an error. However, running truffle test
from the CLI works fine and just returns 0 passing
.
Here is the code
const { expect } = require('chai')
.use(require('chai-as-promised'))
.should()
const Auction = artificats.require('./implementor.sol');
contract('Go',(accounts) => {
let contract
describe('deployment',async() =>{
it('deploys successfully',async ()=>{
contract = await Go.deployed()
const address = contract.address
console.log(address)
console.log('ran')
assert.NotEqual(address,'')
})
} )
})
So I tried it this way because I thought maybe the contract wasn't being created at all.
const { expect } = require('chai')
.use(require('chai-as-promised'))
.should()
const Auction = artificats.require('./implementor.sol');
contract('Go',(accounts) => {
beforeEach(async () => {
this.Go = await Go.new()
});
describe('deployment',async() =>{
let contract
it('deploys successfully',async ()=>{
contract = await Go.deployed();
const address = contract.address;
assert.NotEqual(address,'');
return(address);
});
} );
});