0
 truffle test
Using network 'development'.


Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

/home/ubuntutest/proyectoico/test/testMasterICO.js:18
  it("Does the first buy"; async function() {
     ^^^^^^^^^^^^^^^^^^^^

SyntaxError: missing ) after argument list
    at Module._compile (internal/modules/cjs/loader.js:743:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at /usr/local/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:231:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/usr/local/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:228:14)
    at Mocha.run (/usr/local/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:536:10)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/test.js:118:1
    at processTicksAndRejections (internal/process/next_tick.js:81:5)

 Truffle v5.0.7 (core: 5.0.7)
Node v11.11.0

The code in the contract:

  it("Does the first buy"; async function() {
    const preBalance = await masterToken.balanceOf(addressTokenHolder1);
    const preTotalEth = await web3.eth.getBalance(addressEther);
    await masterToken.sendTransaction({
      value: web3.toWei(1),
      gas: 300000,
      gasPrice: "20000000000",
      from: addressTokenHolder1
    });
    const postBalance = await masterToken.balanceOf(addressTokenHolder1);
    const postTotalEth = await web3.eth.getBalance(addressEther);
    const currentBalance = postBalance - preBalance;
    const currentTotalEth = postTotalEth - preTotalEth;
    assert.equal(web3.fromWei(currentBalance), 1);
    assert.equal(web3.fromWei(currentTotalEth), 1);
  });
});

Thanks!

closed as off-topic by Richard Horrocks, Ismael, Achala Dissanayake, goodvibration, Rosco Kalis Mar 9 at 8:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Ethereum, the decentralized application platform and smart contract enabled blockchain, within the scope defined in the help center." – Richard Horrocks, Ismael, Achala Dissanayake, goodvibration, Rosco Kalis
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    This has nothing to do with Ethereum. Your JavaScript simply has invalid syntax. Hard to be sure without seeing the rest of the code, but I assume the semicolon should be a comma. – user19510 Mar 8 at 23:18
2

Most likely, this line is wrong:

it("Does the first buy"; async function() {

The function it takes two arguments, a description of the test you're running and an async function that executes that test. They must be separated by a comma.

Not the answer you're looking for? Browse other questions tagged or ask your own question.