Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shouldFail.reverting.withMessage on non-Ganache #25

Commits on Apr 3, 2019

  1. 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`.
    scottt committed Apr 3, 2019
    Copy the full SHA
    a58fd87 View commit details
    Browse the repository at this point in the history