I keep getting this problem, anyone an idea? @filip
truffle(ganache)> test
Using network ‘ganache’.
Compiling your contracts…
Compiling .\contracts\Ownable.sol
Contract: People
1) should’t create a person with age over 150 years
> No events were emitted
0 passing (184ms)
1 failing
- Contract: People
should’t create a person with age over 150 years :
TypeError: Cannot read property ‘REVERT’ of undefined
at Context. (test\PeopleTest.js:7:136)
at process._tickCallback (internal/process/next_tick.js:68:7)
1
truffle(ganache)> { Error: Returned error: VM Exception while processing transaction: revert Age needs to be below 150 – Reason given: Age needs to be below 150. at PromiEvent (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\promievent.js:6:1)
at TruffleContract.createPerson (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\execute.js:158:1)
at Context. (C:\DOC\eth\PeopleProject\test\PeopleTest.js:7:40)
at process._tickCallback (internal/process/next_tick.js:68:7)
reason: ‘Age needs to be below 150’,
hijackedStack:
‘Error: Returned error: VM Exception while processing transaction: revert Age needs to be below 150 – Reason given: Age needs to be below 150.\n at Object.ErrorResponse (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-core-helpers\src\errors.js:29:1)\n at C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-core-requestmanager\src\index.js:140:1\n at C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\provider\wrapper.js:112:1\n at XMLHttpRequest.request.onreadystatechange (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-providers-http\src\index.js:96:1)\n at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request-event-target.js:34:1)\n at XMLHttpRequest._setReadyState (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:208:1)\n at XMLHttpRequest._onHttpResponseEnd (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:318:1)\n at IncomingMessage. (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:289:47)\n at IncomingMessage.emit (events.js:203:15)\n at IncomingMessage.EventEmitter.emit (domain.js:466:23)\n at endReadableNT (_stream_readable.js:1143:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)’ }
{ Error: Returned error: VM Exception while processing transaction: revert Age needs to be below 150 – Reason given: Age needs to be below 150. at PromiEvent (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\promievent.js:6:1)
at TruffleContract.createPerson (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\execute.js:158:1)
at Context. (C:\DOC\eth\PeopleProject\test\PeopleTest.js:7:40)
at process._tickCallback (internal/process/next_tick.js:68:7)
reason: ‘Age needs to be below 150’,
hijackedStack:
‘Error: Returned error: VM Exception while processing transaction: revert Age needs to be below 150 – Reason given: Age needs to be below 150.\n at Object.ErrorResponse (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-core-helpers\src\errors.js:29:1)\n at C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-core-requestmanager\src\index.js:140:1\n at C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\provider\wrapper.js:112:1\n at XMLHttpRequest.request.onreadystatechange (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-providers-http\src\index.js:96:1)\n at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request-event-target.js:34:1)\n at XMLHttpRequest._setReadyState (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:208:1)\n at XMLHttpRequest._onHttpResponseEnd (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:318:1)\n at IncomingMessage. (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:289:47)\n at IncomingMessage.emit (events.js:203:15)\n at IncomingMessage.EventEmitter.emit (domain.js:466:23)\n at endReadableNT (_stream_readable.js:1143:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)’ }
C:\Users\VAIO-PC.config\truffle\compilers\node_modules\soljson-v0.5.12+commit.7709ece9.js:33
(Module.asmGlobalArg,Module.asmLibraryArg,buffer);var __GLOBAL__I_000101=Module["__GLOBAL__I_000101"]=asm["__GLOBAL__I_000101"];var __GLOBAL__sub_I_ABIFunctions_cpp=Module["__GLOBAL__sub_I_ABIFunctions_cpp"]=asm["__GLOBAL__sub_I_ABIFunctions_cpp"];var __GLOBAL__sub_I_ABI_cpp=Module["__GLOBAL__sub_I_ABI_cpp"]=asm["__GLOBAL__sub_I_ABI_cpp"];var __GLOBAL__sub_I_ASTJsonConverter_cpp=Module["__GLOBAL__sub_I_ASTJsonConverter_cpp"]=asm["__GLOBAL__sub_I_ASTJsonConverter_cpp"];var __GLOBAL__sub_I_AST_cpp=Module["__GLOBAL__sub_I_AST_cpp"]=asm["__GLOBAL__sub_I_AST_cpp"];var __GLOBAL__sub_I_ArrayUtils_cpp=Module["__GLOBAL__sub_I_ArrayUtils_cpp"]=asm["__GLOBAL__sub_I_ArrayUtils_cpp"];var __GLOBAL__sub_I_AsmAnalysis_cpp=Module["__GLOBAL__sub_I_AsmAnalysis_cpp"]=asm["__GLOBAL__sub_I_AsmAnalysis_cpp"];var __GLOBAL__sub_I_BMC_cpp=Module["__GLOBAL__sub_I_BMC_cpp"]=asm["__GLOBAL__sub_I_BMC_cpp"];var GLOBAL__sub_I_CHC_cpp=Module["
abort({“reason”:“Age needs to be below 150”,“hijackedStack”:“Error: Returned error: VM Exception while processing transaction: revert Age needs to be below 150 – Reason given: Age needs to be below 150.\n at Object.ErrorResponse (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-core-helpers\src\errors.js:29:1)\n at C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-core-requestmanager\src\index.js:140:1\n at C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\provider\wrapper.js:112:1\n at XMLHttpRequest.request.onreadystatechange (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-providers-http\src\index.js:96:1)\n at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request-event-target.js:34:1)\n at XMLHttpRequest._setReadyState (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:208:1)\n at XMLHttpRequest._onHttpResponseEnd (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:318:1)\n at IncomingMessage. (C:\Users\VAIO-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:289:47)\n at IncomingMessage.emit (events.js:203:15)\n at IncomingMessage.EventEmitter.emit (domain.js:466:23)\n at endReadableNT (_stream_readable.js:1143:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)”}). Build with -s ASSERTIONS=1 for more info.
C:\DOC\eth\PeopleProject>