I am using node v12.13.1, [email protected] and ubuntu 18.04 and running the test using documentation of async/await.
https://www.trufflesuite.com/docs/truffle/testing/writing-tests-in-javascript#using-async-await
This is my test code:
const DappTokenSale = artifacts.require("DappTokenSale");
const DappToken = artifacts.require("DappToken");
contract("DappToken", async accounts => {
let dapptokenInstance = await DappToken.deployed();
let dapptokenSale = await DappTokenSale.deployed();
let admin = accounts[0]
console.log(admin)
let buyer = accounts[1]
let tokenPrice = 1000000000000000; //wei (0.001 ether)
// 3. Set the token available for sale
let tokensAvailable = 750000;
let numberOfTokens;
it("Token buying", async() => {
console.log(admin)
let dapptokenInstance = await DappToken.deployed();
console.log(dapptokenInstance.address, "hello")
})
})
But there is no console.logs (e.g. console.log(admin)) when I run the tests.
truffle compile --all
.