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

Tests don’t compile the first time after contract API changes #26

Open
geigerzaehler opened this issue Oct 1, 2020 · 2 comments
Open

Comments

@geigerzaehler
Copy link

Changes in the contract APIs should be reflected in the TypeScript contract bindinings for ethers. However, these changes are not picked up by yarn test when run for the first time.

When we make a change to a contract yarn test will recompile the contract and generate bindings with typechain. Then the tests, which import the bindings, are typechecked and run. However the tests are typechecked against the bindings from the unchanged contracts.

A second invocation of yarn test picks up the changed bindings that were build in the previous invocation.

@CodeSandwich
Copy link
Contributor

I'm unable to reproduce this issue. I'm adding a function to the contract, adding its usage in a test, running yarn run test and it's passing just fine. After yarn run test my IDE start correctly autocompleting in tests with the new function. There were some updates in the meantime, could you check if you're still able to reproduce it?

@geigerzaehler
Copy link
Author

I’m still seeing this issue. One way to easily reproduce this is to rm contract-bindings && yarn run test.

The IDE is fine, though. I believe that yarn test caches the content of the files on start up. When the process changes the files the change is not picked up.

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