-
Notifications
You must be signed in to change notification settings - Fork 12k
First test helpers tests #1369
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
First test helpers tests #1369
Conversation
|
||
describe('advanceBlock', function () { | ||
it('increases the block number by one', async function () { | ||
await advanceToBlock.advanceBlock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about rename advanceToBlock
to something like blocks
? or fakeMiner
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't like this, but users will usually import the function directly (i.e. const { advanceToBlock} = require('advanceBlock')
). I imported the whole module in the test to make it clear what each function is testing.
These should all be replaced once we mock all time usage anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wooo, tests for the tests!!!
I've just left a nit because I don't like advanceBlockTo.advanceBlock.
All the rest, +1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok then.
* Removed unused advanceToBlock. * Added advanceBlock tests. * Fixed advanceToBlock tests. * Added single argument tests. * Finished inLogs tests. * Fixed linter errors. * Fixed linter errors. (cherry picked from commit 9f82290)
We now have tests for
advanceBlock
andexpectEvent.inLogs
! The other helpers will come once the refactoring PRs (#1363, #1364) are in.This is part of #1078.