Is it just me or does pocket-ic not work with recent versions of dfx
.
My Setup:
- DFX:
v0.27.0
(latest) - Canister CDK:
ic-cdk v0.13.2
- Testing Library:
pocket-ic v2.2.0
(which is the version compatible withdfx v0.27.0
)
The Problem:
pocket-ic v2.2.0
has a strict dependency on ic-cdk = "=0.12.0"
. This directly conflicts with using the newer features in ic-cdk v0.13+
in my main canisters.
Since I’m already on the latest dfx
, upgrading it is not an option.
I recently upgraded from 0.18-0.27 because of a failure to set up pocket-ic (similar toolchain issues).
Attempted Workaround & Roadblock:
I could isolate the test crate and use a [patch]
in a local .cargo/config.toml
to override ic-cdk
just for the tests, but for separate unknown reasons I could never get the tests to run.
So, my question is: How are others successfully testing modern canisters against the latest dfx
version? Is there a more reliable way to override the test dependencies, or another strategy entirely?
P.S. I’ve always avoided pocket-ic but now I really need it. Since I never used it I might also be missing something minor/foolish here.