Created
September 6, 2019 20:38
-
-
Save alexytiger/d98f73403048194e9d4a50005220627c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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