test: verify asset canister contains candid:service metadata
Since the asset canister .wasm is stored directly in the repo, and updated manually, and adding candid:service metadata is a manual step until dfx 0.11.0, make sure it includes candid:service metadata.
@@ -24,3 +24,14 @@ teardown() {
dfx canister metadata hello_backend candid:service >metadata.txt
assert_command diff .dfx/local/canisters/hello_backend/hello_backend.did ./metadata.txt
}
+
+@test "asset canister provides candid:service metadata" {
+ dfx_new hello
+ dfx_start
+
+ assert_command dfx deploy
+ REPO_ROOT=${BATS_TEST_DIRNAME}/../../
+
+ dfx canister metadata hello_frontend candid:service >candid_service_metadata.txt
+ assert_command diff "$REPO_ROOT/src/distributed/assetstorage.did" ./candid_service_metadata.txt
+}
