-
Notifications
You must be signed in to change notification settings - Fork 790
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 State Manager API tests to karma #653
Conversation
Sorry about the prettified files, the diffs are a bit hard to read/parse. |
ebee3f9
to
13b25f3
Compare
Codecov Report
@@ Coverage Diff @@
## master #653 +/- ##
======================================
Coverage 91.4% 91.4%
======================================
Files 31 31
Lines 1978 1978
Branches 326 326
======================================
Hits 1808 1808
Misses 90 90
Partials 80 80
Continue to review full report at Codecov.
|
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.
exclude: [ | ||
'./tests/api/state/stateManager.js', // 4, "# should clear the cache when the state root is set" | ||
], | ||
exclude: [], |
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.
👍
13b25f3
to
1dd35f6
Compare
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.
Logic was extracted to isRunningInKarma()
.
|
||
st.equal(stateRoot.toString('hex'), genesisData.genesis_state_root) | ||
t.test('should generate the genesis state root correctly for mainnet', async st => { | ||
if (isRunningInKarma()) { |
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.
👍
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.
Yes, can confirm that this is hard to read/review 😛, next time stuff like this should better be two subsequent PRs, otherwise the structural risk to overlook something is unnecessarily increased.
Otherwise looks good. Won't merge myself, not sure if this intervenes somehow with the monorepo process or something, but otherwise @evertonfraga or @ryanio feel free to merge.
This is increased browser (type) coverage is also cool, browser compatibility gets historically somewhat too little attention within EthereumJS.
Thanks, sounds good. In the future if a file isn't prettified I'll leave it out so the diff is cleaner and run the prettify in a separate PR. |
This PR:
tests/api/state/stateManager.js
back to karma.should generate the genesis state root correctly for mainnet
should generate correct genesis state root for all chains
toshould generate the genesis state root correctly for all other chains
(since mainnet is already tested prior).karma-detect-browsers
.Closes #465