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

🧪 Test helper functions #228

Open
jtfirek opened this issue May 8, 2023 · 1 comment
Open

🧪 Test helper functions #228

jtfirek opened this issue May 8, 2023 · 1 comment

Comments

@jtfirek
Copy link
Collaborator

jtfirek commented May 8, 2023

The way we are using the helper functions in the new mocked test will not catch bugs introduced in helper functions like prepareTransaction.

expect(spy).toHaveBeenCalledWith(
rpcUrl,
buildFetchInit(
buildRPCPostBody('eth_call', [prepareTransaction(data), 'latest']),
),
);

We need to make a test for testing the helpers like:
prepareTransaction
buildRPCPostBody
toChecksumAddress
cleanLog
Lmk what other helpers need to be tested @dawsbot

@dawsbot
Copy link
Owner

dawsbot commented May 12, 2023

Great idea, feel free to make a PR for this whenever @jtfirek . It will be good to be confident our helpers are doing what we think so that one break to helper shows up in the tests right there instead of downstream and we only notice it in a different function!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants