You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we need to explicitly deploy a smart contract in the cadence unit or integration tests, e.g.:
import "FLIXRegistry"
...
...
access(all)
fun setup() {
let flixRegistryErr = Test.deployContract(
name: "FLIXRegistry",
path: "../contracts/flix_registry.cdc",
arguments: []
)
...
In the above example FLIXRegistry cannot be referenced in the code before it was deployed with Test.deployContract, even if it is imported on the the top, and defined in the flow.json as follows:
It could increase developer experience if smart contracts defined in the flow.json are readily available in the unit tests, so the developers only have to import those as dependencies.
Also it could keep the unit tests code more concise and clean.
(Optional): Context
The text was updated successfully, but these errors were encountered:
@wfalcon0x do they need to be deployed? It seems like you'd want to keep control of deployment in your tests for state. Would the issue be solved for you if the import syntax worked correctly in tests?
It was my assumption that they need to be deployed to make it work based on the current behaviour. But I think you make a good point, and there are 2 separate issues.
for the actual problem I faced they don't need to be deployed, i just wanted to be able to reference a resource, before they were deployed
it would be nice to have a way to deploy them, so I don't have to control the deployment from the test in every case
Instructions
Issue To Be Solved
Currently we need to explicitly deploy a smart contract in the cadence unit or integration tests, e.g.:
In the above example FLIXRegistry cannot be referenced in the code before it was deployed with Test.deployContract, even if it is imported on the the top, and defined in the flow.json as follows:
(Optional): Suggest A Solution
It could increase developer experience if smart contracts defined in the flow.json are readily available in the unit tests, so the developers only have to import those as dependencies.
Also it could keep the unit tests code more concise and clean.
(Optional): Context
The text was updated successfully, but these errors were encountered: