Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Jun 29, 2024
1 parent 2b37061 commit 8da5f82
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/canister/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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 () => {
Expand Down
2 changes: 2 additions & 0 deletions examples/cross_canister_calls/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}

Expand Down

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

Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
});
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
});
Expand Down

0 comments on commit 8da5f82

Please sign in to comment.