在 truffle init (Mac OSX) 之后,一些 Truffle 测试没有 运行 未捕获的 TypeError

Some Truffle tests not running after truffle init (Mac OSX) Uncaught TypeError

我正在尝试使用 truffle 构建一个 dapp。我已经使用 NPM 在全球范围内安装了 Testrpc 和 Truffle。我 运行 在终端 window 和 运行 truffle 测试中测试 rpc。我得到 2 个通过和 3 个失败的测试。三个失败的测试是

TestMetacoin testInitialBalanceUsingDeployedContract:

TestMetacoin testInitialBalanceWithNewMetaCoin:

Contract: MetaCoin should send coin correctly:

每个都在同一个地方失败:

Uncaught TypeError: Cannot read property '1' of undefined
  at /usr/local/lib/node_modules/truffle/node_modules/ethjs-abi/lib/index.js:139:34
  at Array.map (native)
  at Object.decodeEvent (/usr/local/lib/node_modules/truffle/node_modules/ethjs-abi/lib/index.js:138:6)
  at /usr/local/lib/node_modules/truffle/node_modules/truffle-contract/contract.js:73:38
  at Array.map (native)
  at Object.decodeLogs (/usr/local/lib/node_modules/truffle/node_modules/truffle-contract/contract.js:44:19)
  at Object.callback (/usr/local/lib/node_modules/truffle/node_modules/truffle-contract/contract.js:172:35)
  at /usr/local/lib/node_modules/truffle/node_modules/truffle-contract/node_modules/web3/lib/web3/method.js:142:25
  at /usr/local/lib/node_modules/truffle/node_modules/truffle-contract/node_modules/web3/lib/web3/requestmanager.js:89:9
  at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:119:13)
  at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:64:18)
  at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:354:12)
  at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:509:12)
  at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:469:24)

我确定我遗漏了一些简单的东西,我们将不胜感激。

这是一个错误。他们已经修好了。

Github 问题:https://github.com/trufflesuite/truffle/issues/377

所以,只需重新安装 truffle