Hello i am using mocha and chai testing framework and library into the below code but this code give me a error at the time of when i am create the products using cretateProducts function. and the error in createProducts is not a function.
var TestForSmartContract = artifacts.require('MarketPlace.sol');
var assert = require('assert');
contract("MarketPlace",(accounts)=>{
let marketplace;
describe('Deploy Or Not',()=>{
it("Deploy SuccessFully",()=>{
const address = TestForSmartContract.address;
assert.notEqual(address,"");
assert.notEqual(address,0x0);
assert.notEqual(address,null);
assert.notEqual(address,undefined);
});
})
describe("For The Products",()=>{
let createProducts;
let counts;
before(async()=>{
createProducts = TestForSmartContract.CrateProducts('I-Phone',web3.utils.toWei('1','Ether'));
counts = TestForSmartContract.productsCount();
})
it('The Producst Count',()=>{
assert.equal(counts,1);
})
})
})