-
Notifications
You must be signed in to change notification settings - Fork 5k
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 eventemitter3 #6823
add eventemitter3 #6823
Conversation
Bundle StatsHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller
Unchanged
|
Benchmark
This comment was automatically generated by workflow using github-action-benchmark. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 4.x #6823 +/- ##
==========================================
+ Coverage 87.37% 91.98% +4.61%
==========================================
Files 197 215 +18
Lines 7548 8162 +614
Branches 2059 2201 +142
==========================================
+ Hits 6595 7508 +913
+ Misses 953 654 -299
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -97,23 +97,6 @@ describe('IPCProvider', () => { | |||
expect(end).toHaveBeenCalled(); | |||
}); | |||
|
|||
it('connection error', async () => { |
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.
removed connection error test, mock implementation doesn't seem to emit error for this one unit test so i added an integration test to substitute it
https://github.com/web3/web3.js/pull/6823/files#diff-ea6da20dfb39c75b95f9a7cb4cf0e3f9d1e353fe0aab69f28ef83497e86ff556R140
@@ -755,7 +756,7 @@ describe('Contract', () => { | |||
|
|||
const clonnedContract = contract.clone(); | |||
|
|||
expect(JSON.stringify(contract)).toStrictEqual(JSON.stringify(clonnedContract)); | |||
expect(stringify(contract)).toStrictEqual(stringify(clonnedContract)); |
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.
eventemitter3 has a circular structure so we use stringify library to parse properly
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.
whats error for that?
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.
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'EventEmitter'
@@ -85,28 +85,14 @@ describe('WebSocketProvider', () => { | |||
ws.disconnect(code, data); | |||
expect(close).toHaveBeenCalledWith(code, data); | |||
}); | |||
it('connection error', async () => { |
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.
removed connection error test, mock implementation doesn't seem to emit error for this one unit test so i added an integration test to substitute it
https://github.com/web3/web3.js/pull/6823/files#diff-ea6da20dfb39c75b95f9a7cb4cf0e3f9d1e353fe0aab69f28ef83497e86ff556R140
Its not showing difference |
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.
please take a look at tests.
replacing nodejs and web3js implemetation of eventemitter for the usage of eventemitter3 for react-native compatibiltiy.
Description
Please include a summary of the changes and be sure to follow our Contribution Guidelines.
Type of change
Checklist:
npm run lint
with success and extended the tests and types if necessary.npm run test:unit
with success.npm run test:coverage
and my test cases cover all the lines and branches of the added code.npm run build
and testeddist/web3.min.js
in a browser.CHANGELOG.md
file in the root folder.