radicle-contracts
radicle-contracts copied to clipboard
Tests don’t compile the first time after contract API changes
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.
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?
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.