once again I have problems following this course… @filip please your help:
A question before… If we are importing the contract People into test, shouldn ’ t we use the const Peoplecontract instead of “People”?
everything compiles and migrates fine, but when I do the test, i get the following error:
TypeError [ERR_INVALID_REPL_INPUT]: Listeners for uncaughtException
cannot be used in the REPL
at process. (repl.js:302:15)
at process.emit (events.js:326:22)
at process.emit (/usr/lib/node_modules/truffle/build/webpack:/~/source-map-support/source-map-support.js:465:1)
at processEmit [as emit] (/usr/lib/node_modules/truffle/build/webpack:/~/signal-exit/index.js:155:1)
at _addListener (events.js:357:14)
at process.addListener (events.js:405:10)
at Runner.run (/usr/lib/node_modules/truffle/node_modules/mocha/lib/runner.js:868:11)
at Mocha.run (/usr/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:612:17)
at /usr/lib/node_modules/truffle/build/webpack:/packages/core/lib/test.js:128:1
at new Promise ()
at Object.run (/usr/lib/node_modules/truffle/build/webpack:/packages/core/lib/test.js:127:1)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
my code for the test file is as follows:
const Peoplecontract = artifacts.require("People");
const truffleAssert = require("truffle-assertions");
contract ("People", async function(){
it("shouldn't create a person with age over 150 years", async function(){
let instance = await People.deployed();
await truffleAssert.fails(instance.createPerson("bob", 200, 190, {value: web3.utils.toWei("1", "ether")}));
});
});