Skip to content

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

Merged
merged 7 commits into from
Oct 10, 2018
Merged

Conversation

nventuro
Copy link
Contributor

@nventuro nventuro commented Oct 1, 2018

We now have tests for advanceBlock and expectEvent.inLogs! The other helpers will come once the refactoring PRs (#1363, #1364) are in.

This is part of #1078.

@nventuro nventuro added kind:improvement tests Test suite and helpers. labels Oct 1, 2018
@nventuro nventuro added this to the v2.1 milestone Oct 1, 2018
@nventuro nventuro self-assigned this Oct 1, 2018
@nventuro nventuro requested a review from frangio October 1, 2018 14:40
@nventuro nventuro requested review from come-maiz and removed request for frangio October 7, 2018 05:17

describe('advanceBlock', function () {
it('increases the block number by one', async function () {
await advanceToBlock.advanceBlock();
Copy link
Contributor

@come-maiz come-maiz Oct 10, 2018

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@come-maiz come-maiz left a 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.

Copy link
Contributor

@come-maiz come-maiz left a comment

Choose a reason for hiding this comment

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

ok then.

@nventuro nventuro merged commit 9f82290 into OpenZeppelin:master Oct 10, 2018
@nventuro nventuro deleted the test-helpers-tests branch October 10, 2018 23:55
come-maiz pushed a commit that referenced this pull request Oct 21, 2018
* 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)
@come-maiz come-maiz modified the milestones: v2.1, v2.0 Oct 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Test suite and helpers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants