Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Created September 6, 2019 20:38
Show Gist options
  • Save alexytiger/d98f73403048194e9d4a50005220627c to your computer and use it in GitHub Desktop.
Save alexytiger/d98f73403048194e9d4a50005220627c to your computer and use it in GitHub Desktop.
const FleaMarket = artifacts.require("../contracts/FleaMarket");
const SafeRemotePurchase = artifacts.require("../build/contracts/SafeRemotePurchase");
var BN = web3.utils.BN;
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised).should();
contract("FleaMarket", accounts => {
let [deployer, seller, buyer] = accounts;
let contractInstance;
before(async () => {
// To get an instance of a deployed contract in truffle
contractInstance = await FleaMarket.deployed();
// specify three test accounts
console.log(`deployer account: ${deployer}`);
console.log(`seller account: ${seller}`);
console.log(`buyer account: ${buyer}`);
});
describe("deployment", async () => {
it("deploys successfully", async () => {
const address = await contractInstance.address;
console.log(`contract address: ${address}`);
//make sure the address is real
assert.notEqual(address, 0x0);
assert.notEqual(address, "");
assert.notEqual(address, null);
assert.notEqual(address, undefined);
});
it('has a name', async () => {
const name = await contractInstance.name()
assert.equal(name, 'FleaMarket Smart Contract')
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment