Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix shouldFail.reverting.withMessage on non-Ganache
Currently `shouldFail.reverting.withMessage` tries to execute the following regular expression match: ``` /TestRPC\/v([0-9.]+)\/ethereum-js/.exec(web3ClientVersion) ``` When `web3ClientVersion` has a value like `Geth/v1.8.9-unstable-d4ac250e/linux-amd64/go1.9.4`, which would likely occur when testing against any non-Ganache chain implementation, `RegExp.prototype.exec()` would return `null` causing an error like: ``` TypeError: Cannot use 'in' operator to search for '1' in null ``` when `1 in matches` is evaluated in the subsequent code. This patch fixes things by testing for `matches` being `null` or `matches[1]` not being valid explicitly. Tested with `npm run test` and `npm run test-integration`.
- Loading branch information