OpenZeppelin / openzeppelin-test-environment

[Not actively maintained] One-line setup for blazing-fast smart contracts tests
https://docs.openzeppelin.com/test-environment
MIT License
90 stars 39 forks source link

TypeError: Cannot read property 'readdir' of undefined when running test:integration #132

Closed wenhaosu closed 4 years ago

wenhaosu commented 4 years ago

When I cloned this project and ran npm run test:integration after running npm install, I got the following error:

$ npm run test:integration

> @openzeppelin/test-environment@0.1.4 test:integration /home/wenhao/openzeppelin-test-environment
> node scripts/run-integration-test.js

(node:97482) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'readdir' of undefined
    at run (/home/wenhao/openzeppelin-test-environment/scripts/run-integration-test.js:24:22)
    at Object.<anonymous> (/home/wenhao/openzeppelin-test-environment/scripts/run-integration-test.js:19:3)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
(node:97482) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:97482) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Seems it is having trouble executing the following command and could not find that directory:

tests = await fs.readdir('test-integration');

However this directory is exactly inside the path where I executed the npm run test:integration command. Am I missing some kind of configuration here?

BTW the npm run test:unit command can be executed normally and gives the correct result.

frangio commented 4 years ago

I believe this error was due to using an old version of Node. At least Node.js 10 is required.