Skip to content

Commit

Permalink
feat: tests are running
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Nov 8, 2023
1 parent cf8f9b5 commit 94876f6
Show file tree
Hide file tree
Showing 14 changed files with 228 additions and 212 deletions.
200 changes: 0 additions & 200 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ version = "0.1.0"
[workspace.dependencies]
async-trait = "0.1"
candid = "0.9"
chrono = "0.4"
ic-cdk = "0.11"
ic-cdk-macros = "0.8"
ic-stable-structures = "0.6"
itertools = "0.11"
log = "0.4"
num-bigint = "0.4"
serde = { version = "1", features = ["derive"] }
thiserror = "1.0"
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
"license": "MIT",
"private": true,
"scripts": {
"test": "vitest"
"test": "vitest run"
},
"devDependencies": {
"isomorphic-fetch": "^3.0.0",
"vitest": "^0.34.6"
},
"dependencies": {
"@dfinity/agent": "^0.19.3",
"@dfinity/candid": "^0.19.3",
"@dfinity/principal": "^0.19.3"
}
}
4 changes: 2 additions & 2 deletions integration-tests/tests/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ const createActor = async (canisterId, options) => {
});
};

export const sellContract = await createActor(canisterIds.sell_contract, {
agentOptions: { host: "http://localhost:8000", fetch },
export const sellContract = await createActor(canisterIds.sell_contract.local, {
agentOptions: { host: "http://localhost:4943", fetch },
});
2 changes: 1 addition & 1 deletion integration-tests/tests/sell_contract.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from "vitest";
import { Principal } from "@dfinity/principal";

import { sellContract } from "./actor.js";
import { sellContract } from "./actor";

test("should be able to update fly canister principal", async () => {
const principal = Principal.fromText("rrkah-fqaaa-aaaaa-aaaaq-cai");
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
borc "^2.1.1"
simple-cbor "^0.4.1"

"@dfinity/candid@^0.19.3":
version "0.19.3"
resolved "https://registry.yarnpkg.com/@dfinity/candid/-/candid-0.19.3.tgz#edc3491572d293824b821ce3a4fc50f5b4714f4d"
integrity sha512-yXfbLSWTeRd4G0bLLxYoDqpXH3Jim0P+1PPZOoktXNC1X1hB+ea3yrZebX75t4GVoQK7123F7mxWHiPjuV2tQQ==

"@dfinity/principal@^0.19.3":
version "0.19.3"
resolved "https://registry.yarnpkg.com/@dfinity/principal/-/principal-0.19.3.tgz#428cfca3d2d2de9e1433b3b33498fd595fb441d8"
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ deploy_sell_contract() {
custodians = vec { principal \"$ADMIN_PRINCIPAL\" };
})"

dfx canister install --mode=$INSTALL_MODE --yes --network="$NETWORK" --argument="$sell_contract_init_args" sell_contract
dfx deploy --mode=$INSTALL_MODE --yes --network="$NETWORK" --argument="$sell_contract_init_args" sell_contract

}
4 changes: 3 additions & 1 deletion scripts/dfx-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ source ./deploy_functions.sh
dfx stop
dfx start --background

cd ../

deploy_sell_contract "reinstall" "local" "$SELL_CONTRACT_PRINCIPAL" "$FLY_PRINCIPAL" "$MARKETPLACE_PRINCIPAL" "$ADMIN_PRINCIPAL"

cd ../integration-tests/
cd ./integration-tests/

yarn && yarn test
RES=$?
Expand Down
Loading

0 comments on commit 94876f6

Please sign in to comment.