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

Testing improvements #513

Merged
merged 3 commits into from
Apr 23, 2019
Merged

Testing improvements #513

merged 3 commits into from
Apr 23, 2019

Conversation

sohkai
Copy link
Contributor

@sohkai sohkai commented Apr 18, 2019

Adds some improvements to the test suite, as per the Consensys Diligence advisory.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.542% when pulling ba6fff8 on testing-improvements into 1b67d10 on dev.

@@ -37,6 +37,9 @@ const processResult = txReceipt => {
throw new Error(log.args.message)
}
})
if (mustAssert && !decodedLogs.length) {
throw new Error('No assertions made')
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if this is necessary, test fwks usually don't throw if there are no assertions, they simply throw in case there was at least one failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes... it is kind of "special" behaviour but for our purposes I think having this check is more robust:

  1. Tests without explicit assertions made are probably buggy in some way
  2. This implicitly tests that the test framework is working (decoding Assert's events), avoiding an earlier issue where the tests were always just passing regardless of actual test behaviour.

Copy link
Contributor

@facuspagnuolo facuspagnuolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left one minor comment tho.

@sohkai sohkai merged commit 635dd96 into dev Apr 23, 2019
@sohkai sohkai deleted the testing-improvements branch April 23, 2019 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants