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

🧪 Added testing for bytes functions imported from ethers.js #134

Merged
merged 14 commits into from
May 29, 2022

Conversation

arimgibson
Copy link
Contributor

@arimgibson arimgibson commented May 26, 2022

Closes #103

  • Added tests for hexConcat() function
  • Added tests for hexDataLength() function
  • Added tests for hexStripZeros() function
  • Added tests for hexValue() function
  • Added tests for isBytesLike() function
  • Added tests for isHexString() function
  • Added tests for stripZeros() function
  • Added tests for zeroPad() function
  • Hit 100% coverage on Bytes functions
  • Ensure that tests are consistent

@arimgibson arimgibson self-assigned this May 26, 2022
@vercel
Copy link

vercel bot commented May 26, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
essential-eth ✅ Ready (Inspect) Visit Preview May 27, 2022 at 8:45PM (UTC)

@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #134 (0f098e3) into master (678ceac) will increase coverage by 4.53%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #134      +/-   ##
==========================================
+ Coverage   86.17%   90.71%   +4.53%     
==========================================
  Files          38       38              
  Lines         926      926              
  Branches      265      265              
==========================================
+ Hits          798      840      +42     
+ Misses        113       76      -37     
+ Partials       15       10       -5     
Impacted Files Coverage Δ
src/utils/bytes.ts 100.00% <ø> (+23.46%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 678ceac...0f098e3. Read the comment docs.

@@ -17,7 +17,7 @@ export type Bytes = ArrayLike<number>;
* @example
* '0x123'
*/
// export type BytesLike = Bytes | string | number;
Copy link
Owner

Choose a reason for hiding this comment

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

🧼 Great cleanup

import { utils as ethers } from 'ethers';
import { hexConcat } from '../../bytes';

describe('utils.hexConcat', () => {
Copy link
Owner

Choose a reason for hiding this comment

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

🛠 This is great testing style

@dawsbot dawsbot marked this pull request as ready for review May 29, 2022 15:30
@dawsbot dawsbot merged commit 203ae56 into master May 29, 2022
@dawsbot dawsbot deleted the test/BytesFns branch May 29, 2022 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants