Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

146
Vistas
How Can i Exports the Solidity Function in mocha and chai testing?

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);
        })
    })
    
})
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda