diff --git a/examples/canister/test/tests.ts b/examples/canister/test/tests.ts index 89ad48b4ef..164223a6d6 100644 --- a/examples/canister/test/tests.ts +++ b/examples/canister/test/tests.ts @@ -12,7 +12,7 @@ export function getTests(canister: ActorSubclass<_SERVICE>): Test { const managementCanister = Principal.fromText('aaaaa-aa'); const result = await canister.canisterParam(managementCanister); - expect(result).toStrictEqual(managementCanister); + expect(result).toEqual(managementCanister); }); it('receives a canister as a return value', async () => { @@ -36,7 +36,7 @@ export function getTests(canister: ActorSubclass<_SERVICE>): Test { ]; const result = await canister.canisterList(canisterList); - expect(result).toStrictEqual(canisterList); + expect(result).toEqual(canisterList); }); it('performs a cross canister call on a canister that was passed in as an argument', async () => { diff --git a/examples/cross_canister_calls/test/tests.ts b/examples/cross_canister_calls/test/tests.ts index 548c735ff4..47cd799551 100644 --- a/examples/cross_canister_calls/test/tests.ts +++ b/examples/cross_canister_calls/test/tests.ts @@ -2,7 +2,9 @@ import { ActorSubclass } from '@dfinity/agent'; import { getCanisterId } from 'azle/dfx'; import { expect, it, Test } from 'azle/test'; +// @ts-ignore this path may not exist when these tests are imported into other test projects import { _SERVICE as CANISTER1_SERVICE } from './dfx_generated/canister1/canister1.did'; +// @ts-ignore this path may not exist when these tests are imported into other test projects import { _SERVICE as CANISTER2_SERVICE } from './dfx_generated/canister2/canister2.did'; export function getTests( diff --git a/tests/end_to_end/candid_rpc/class_syntax/canister/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/canister/package-lock.json index 01671baa6e..6d5fb853b9 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/canister/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/canister/package-lock.json @@ -18,6 +18,7 @@ } }, "../../../../../examples/canister": { + "name": "canister_end_to_end_test_functional_syntax", "dev": true, "dependencies": { "azle": "0.22.0" diff --git a/tests/end_to_end/candid_rpc/class_syntax/canister/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/canister/src/index.ts index 1f1dcd7693..6f57cfc042 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/canister/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/canister/src/index.ts @@ -31,7 +31,7 @@ export default class { @update([Canister], IDL.Text) async canisterCrossCanisterCall(someCanister: Canister) { - return await call(someCanister, 'update1'); + return await call(someCanister, 'update1', { returnIdl: IDL.Text }); } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/complex_init/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/complex_init/package-lock.json index dd08f2c61c..b59f9eddd9 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/complex_init/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/complex_init/package-lock.json @@ -18,6 +18,7 @@ } }, "../../../../../examples/complex_init": { + "name": "complex_init_end_to_end_test_functional_syntax", "dev": true, "dependencies": { "azle": "0.22.0" diff --git a/tests/end_to_end/candid_rpc/class_syntax/complex_init/test/test.ts b/tests/end_to_end/candid_rpc/class_syntax/complex_init/test/test.ts index 122c66eee8..277fbf3431 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/complex_init/test/test.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/complex_init/test/test.ts @@ -1,11 +1,14 @@ import { describe } from '@jest/globals'; import { getCanisterId } from 'azle/dfx'; import { runTests } from 'azle/test'; +import { + getRecTests, + getTests +} from 'complex_init_end_to_end_test_functional_syntax/test/tests'; -import { createActor as createComplexActor } from '../test/dfx_generated/complex_init'; +import { createActor as createComplexActor } from './dfx_generated/complex_init'; // @ts-ignore -import { createActor as createRecActor } from '../test/dfx_generated/rec_init'; -import { getRecTests, getTests } from './tests'; +import { createActor as createRecActor } from './dfx_generated/rec_init'; const complexInitCanister = createComplexActor(getCanisterId('complex_init'), { agentOptions: { diff --git a/tests/end_to_end/candid_rpc/class_syntax/composite_queries/test/pretest.ts b/tests/end_to_end/candid_rpc/class_syntax/composite_queries/test/pretest.ts index 5584f999be..d94978694e 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/composite_queries/test/pretest.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/composite_queries/test/pretest.ts @@ -1,7 +1,11 @@ import { getCanisterId } from 'azle/dfx'; +import { linkAndInstallPatch } from 'azle/test/jest_link'; import { execSync } from 'child_process'; +import { join } from 'path'; async function pretest() { + linkAndInstallPatch(join('examples', 'composite_query')); + execSync(`dfx canister uninstall-code canister1 || true`, { stdio: 'inherit' }); diff --git a/tests/end_to_end/candid_rpc/class_syntax/cross_canister_calls/test/pretest.ts b/tests/end_to_end/candid_rpc/class_syntax/cross_canister_calls/test/pretest.ts index cc5e15dd0d..f03132146d 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/cross_canister_calls/test/pretest.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/cross_canister_calls/test/pretest.ts @@ -1,7 +1,11 @@ import { getCanisterId } from 'azle/dfx'; +import { linkAndInstallPatch } from 'azle/test/jest_link'; import { execSync } from 'child_process'; +import { join } from 'path'; async function pretest() { + linkAndInstallPatch(join('examples', 'cross_canister_calls')); + execSync(`dfx canister uninstall-code canister1 || true`, { stdio: 'inherit' });