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

Add tests for core-subscriptions edge cases #3276

Merged
merged 9 commits into from
Jan 7, 2020

Conversation

cgewecke
Copy link
Collaborator

@cgewecke cgewecke commented Dec 17, 2019

Description

This PR targets #3190 (Provider Improvements)

Adds a few tests for edge cases in web3-core-subscriptions. Found two tiny bugs - have changed the code to fix them.

  • web3.eth.subscribe('newBlockHeaders', 5), which fails in _invalidParams, gave a message like: "invalid params for "5". Expected 1, Got 1."

  • web3.eth.subscribe('does-not-exist') resulted in a syntax error. It should just log a warning to std.out.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Unit tests

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success and extended the tests if necessary.
  • I ran npm run build-all and tested the resulting file/'s from dist folder in a browser.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have tested my code on the live network.

@cgewecke cgewecke added 1.x 1.0 related issues Review Needed Maintainer(s) need to review labels Dec 17, 2019
@coveralls
Copy link

coveralls commented Dec 17, 2019

Coverage Status

Coverage increased (+0.5%) to 85.936% when pulling 9038a7a on pri/more-ganache-tests into a46dbcd on provider-related-improvements.

test/eth.subscribe.ganache.js Outdated Show resolved Hide resolved
test/eth.subscribe.ganache.js Outdated Show resolved Hide resolved
test/eth.subscribe.ganache.js Outdated Show resolved Hide resolved
test/eth.subscribe.ganache.js Outdated Show resolved Hide resolved
test/eth.subscribe.ganache.js Outdated Show resolved Hide resolved
test/eth.subscribe.ganache.js Show resolved Hide resolved
test/eth.subscribe.ganache.js Outdated Show resolved Hide resolved
@nivida nivida removed the Review Needed Maintainer(s) need to review label Jan 7, 2020
@nivida nivida merged commit 5b51b2d into provider-related-improvements Jan 7, 2020
@nivida nivida deleted the pri/more-ganache-tests branch January 9, 2020 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants