From 96f8232bcb11336b7408c4eaa3e33a48ead43973 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Wed, 18 Dec 2024 13:18:34 -0700 Subject: [PATCH 1/4] add throw to find prop tests that don't use this function --- test/index.ts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/test/index.ts b/test/index.ts index fecda4c404..32b3235de0 100644 --- a/test/index.ts +++ b/test/index.ts @@ -6,7 +6,6 @@ import { describe, expect, test } from '@jest/globals'; import * as fc from 'fast-check'; import { join } from 'path'; -import { getCanisterId } from '../dfx'; import { execSyncPretty } from '../src/build/stable/utils/exec_sync_pretty'; export { expect } from '@jest/globals'; import { runBenchmarksForCanisters } from './benchmarks'; @@ -120,26 +119,9 @@ type GetCanisterActorOptions = { export async function getCanisterActor( canisterName: string, - options: GetCanisterActorOptions = {} + _options: GetCanisterActorOptions = {} ): Promise> { - const { createActor } = await import( - join(process.cwd(), 'test', 'dfx_generated', canisterName) - ); - - const agent = - options.agent ?? - new HttpAgent({ - host: 'http://127.0.0.1:8000', - identity: options.identity - }); - - if (process.env.DFX_NETWORK !== 'ic') { - await agent.fetchRootKey(); - } - - return createActor(getCanisterId(canisterName), { - agent - }); + throw new Error('This prop tests uses getCanisterActor and is good to go'); } function processEnvVars(): { From 5d4d45add584b8128b801a5eef1bf178dfef2153 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Thu, 19 Dec 2024 09:53:35 -0700 Subject: [PATCH 2/4] update prop tests to use getCanisterActor --- test/index.ts | 32 ++++++++++++++++++++++++++++---- test/property/get_actor.ts | 19 ++++++------------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/test/index.ts b/test/index.ts index 32b3235de0..aa4f67b16b 100644 --- a/test/index.ts +++ b/test/index.ts @@ -1,13 +1,14 @@ import * as dns from 'node:dns'; dns.setDefaultResultOrder('ipv4first'); -import { ActorSubclass, HttpAgent, Identity } from '@dfinity/agent'; +import { ActorSubclass, Agent, HttpAgent, Identity } from '@dfinity/agent'; import { describe, expect, test } from '@jest/globals'; import * as fc from 'fast-check'; import { join } from 'path'; import { execSyncPretty } from '../src/build/stable/utils/exec_sync_pretty'; export { expect } from '@jest/globals'; +import { getCanisterId } from '../dfx'; import { runBenchmarksForCanisters } from './benchmarks'; import { runFuzzTests } from './fuzz'; @@ -114,14 +115,37 @@ export function defaultPropTestParams(): fc.Parameters { type GetCanisterActorOptions = { identity?: Identity; - agent?: HttpAgent; + agent?: Agent; + parentDir?: string; }; export async function getCanisterActor( canisterName: string, - _options: GetCanisterActorOptions = {} + options: GetCanisterActorOptions = {} ): Promise> { - throw new Error('This prop tests uses getCanisterActor and is good to go'); + const parentDir = options.parentDir ?? join(process.cwd(), 'test'); + const { createActor } = await import( + join(parentDir, 'dfx_generated', canisterName) + ); + + const agent = + options.agent ?? + (await HttpAgent.create({ + host: 'http://127.0.0.1:8000', + shouldFetchRootKey: true + })); + + const actor = createActor(getCanisterId(canisterName), { + agent + }); + + if (typeof canisterName === 'string') { + throw new Error( + 'This prop tests uses getCanisterActor and is good to go' + ); + } + + return actor; } function processEnvVars(): { diff --git a/test/property/get_actor.ts b/test/property/get_actor.ts index 9b6bc00735..c81bd5b822 100644 --- a/test/property/get_actor.ts +++ b/test/property/get_actor.ts @@ -1,8 +1,8 @@ -import { Agent, HttpAgent } from '@dfinity/agent'; +import { Agent } from '@dfinity/agent'; -import { getCanisterId } from '../../dfx'; +import { getCanisterActor } from '../index'; -export function getActor(parentDir: string, agent?: Agent): any { +export async function getActor(parentDir: string, agent?: Agent): Promise { const resolvedPathIndex = require.resolve( `${parentDir}/dfx_generated/canister/index.js` ); @@ -13,15 +13,8 @@ export function getActor(parentDir: string, agent?: Agent): any { delete require.cache[resolvedPathIndex]; delete require.cache[resolvedPathDid]; - // eslint-disable-next-line @typescript-eslint/no-require-imports - const { createActor } = require(`${parentDir}/dfx_generated/canister`); - - return createActor(getCanisterId('canister'), { - agent: - agent ?? - new HttpAgent({ - host: 'http://127.0.0.1:8000', - verifyQuerySignatures: false // TODO Major issue: https://forum.dfinity.org/t/agent-js-0-20-0-is-released-replica-signed-query-edition/24743/16?u=lastmjs - }) + return getCanisterActor('canister', { + parentDir, + agent }); } From c991337f9c84b41eed95a6097c40838308dca30f Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Thu, 19 Dec 2024 10:31:18 -0700 Subject: [PATCH 3/4] move getCanisterActor into separte file to avoid jest --- test/get_canister_actor.ts | 41 ++++++++++++++++++++++++++++++++++++++ test/index.ts | 39 ++---------------------------------- test/property/get_actor.ts | 2 +- 3 files changed, 44 insertions(+), 38 deletions(-) create mode 100644 test/get_canister_actor.ts diff --git a/test/get_canister_actor.ts b/test/get_canister_actor.ts new file mode 100644 index 0000000000..6fe9a12fb2 --- /dev/null +++ b/test/get_canister_actor.ts @@ -0,0 +1,41 @@ +import { HttpAgent, Identity } from '@dfinity/agent'; +import { ActorSubclass } from '@dfinity/agent'; +import { Agent } from '@dfinity/agent'; +import { join } from 'path'; + +import { getCanisterId } from '../dfx'; + +type GetCanisterActorOptions = { + identity?: Identity; + agent?: Agent; + parentDir?: string; +}; + +export async function getCanisterActor( + canisterName: string, + options: GetCanisterActorOptions = {} +): Promise> { + const parentDir = options.parentDir ?? join(process.cwd(), 'test'); + const { createActor } = await import( + join(parentDir, 'dfx_generated', canisterName) + ); + + const agent = + options.agent ?? + (await HttpAgent.create({ + host: 'http://127.0.0.1:8000', + shouldFetchRootKey: true + })); + + const actor = createActor(getCanisterId(canisterName), { + agent + }); + + if (typeof canisterName === 'string') { + throw new Error( + 'This prop tests uses getCanisterActor and is good to go' + ); + } + + return actor; +} diff --git a/test/index.ts b/test/index.ts index aa4f67b16b..61bcb8ec09 100644 --- a/test/index.ts +++ b/test/index.ts @@ -1,19 +1,19 @@ import * as dns from 'node:dns'; dns.setDefaultResultOrder('ipv4first'); -import { ActorSubclass, Agent, HttpAgent, Identity } from '@dfinity/agent'; import { describe, expect, test } from '@jest/globals'; import * as fc from 'fast-check'; import { join } from 'path'; import { execSyncPretty } from '../src/build/stable/utils/exec_sync_pretty'; export { expect } from '@jest/globals'; -import { getCanisterId } from '../dfx'; import { runBenchmarksForCanisters } from './benchmarks'; import { runFuzzTests } from './fuzz'; export type Test = () => void; +export { getCanisterActor } from './get_canister_actor'; + export function runTests( tests: Test, canisterNames: string | string[] | undefined = undefined, @@ -113,41 +113,6 @@ export function defaultPropTestParams(): fc.Parameters { return seed !== undefined ? { ...baseParams, seed, path } : baseParams; } -type GetCanisterActorOptions = { - identity?: Identity; - agent?: Agent; - parentDir?: string; -}; - -export async function getCanisterActor( - canisterName: string, - options: GetCanisterActorOptions = {} -): Promise> { - const parentDir = options.parentDir ?? join(process.cwd(), 'test'); - const { createActor } = await import( - join(parentDir, 'dfx_generated', canisterName) - ); - - const agent = - options.agent ?? - (await HttpAgent.create({ - host: 'http://127.0.0.1:8000', - shouldFetchRootKey: true - })); - - const actor = createActor(getCanisterId(canisterName), { - agent - }); - - if (typeof canisterName === 'string') { - throw new Error( - 'This prop tests uses getCanisterActor and is good to go' - ); - } - - return actor; -} - function processEnvVars(): { shouldRunTests: boolean; shouldRunTypeChecks: boolean; diff --git a/test/property/get_actor.ts b/test/property/get_actor.ts index c81bd5b822..f18d33bb61 100644 --- a/test/property/get_actor.ts +++ b/test/property/get_actor.ts @@ -1,6 +1,6 @@ import { Agent } from '@dfinity/agent'; -import { getCanisterActor } from '../index'; +import { getCanisterActor } from '../get_canister_actor'; export async function getActor(parentDir: string, agent?: Agent): Promise { const resolvedPathIndex = require.resolve( From def89968bf3adeb8e50cf6118f95e2e5b7734c8c Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Thu, 19 Dec 2024 11:23:10 -0700 Subject: [PATCH 4/4] await get actor --- .../test/property/candid_rpc/blob/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/bool/test/generate_tests.ts | 2 +- .../http_request_update/test/generate_tests.ts | 4 ++-- .../candid_rpc/canister_methods/init/test/generate_tests.ts | 2 +- .../canister_methods/inspect_message/test/generate_tests.ts | 2 +- .../canister_methods/query/test/generate_tests.ts | 2 +- .../canister_methods/update/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/float32/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/float64/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/func/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int16/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int32/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int64/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int8/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat16/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat32/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat64/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat8/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/null/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/opt/test/generate_tests.ts | 2 +- .../property/candid_rpc/principal/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/record/test/generate_tests.ts | 2 +- .../property/candid_rpc/recursive/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/text/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/tuple/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/variant/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/vec/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/blob/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/bool/test/generate_tests.ts | 2 +- .../http_request_update/test/generate_tests.ts | 4 ++-- .../candid_rpc/canister_methods/init/test/generate_tests.ts | 2 +- .../canister_methods/inspect_message/test/generate_tests.ts | 2 +- .../canister_methods/query/test/generate_tests.ts | 2 +- .../canister_methods/update/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/float32/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/float64/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/func/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int16/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int32/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int64/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/int8/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat16/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat32/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat64/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/nat8/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/null/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/opt/test/generate_tests.ts | 2 +- .../property/candid_rpc/principal/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/record/test/generate_tests.ts | 2 +- .../property/candid_rpc/recursive/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/text/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/tuple/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/variant/test/generate_tests.ts | 2 +- .../test/property/candid_rpc/vec/test/generate_tests.ts | 2 +- test/get_canister_actor.ts | 6 ------ 59 files changed, 60 insertions(+), 66 deletions(-) diff --git a/examples/experimental/test/property/candid_rpc/blob/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/blob/test/generate_tests.ts index 486dfabddd..4d2d17aef4 100644 --- a/examples/experimental/test/property/candid_rpc/blob/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/blob/test/generate_tests.ts @@ -21,7 +21,7 @@ export function generateTests( { name: `blob ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...paramBlobs.map( diff --git a/examples/experimental/test/property/candid_rpc/bool/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/bool/test/generate_tests.ts index f502a7d3d1..7f0a73a99f 100644 --- a/examples/experimental/test/property/candid_rpc/bool/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/bool/test/generate_tests.ts @@ -20,7 +20,7 @@ export function generateTests( { name: `bool ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/canister_methods/http_request_update/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/canister_methods/http_request_update/test/generate_tests.ts index 7b0a90a19b..597741596a 100644 --- a/examples/experimental/test/property/candid_rpc/canister_methods/http_request_update/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/canister_methods/http_request_update/test/generate_tests.ts @@ -22,7 +22,7 @@ export function generateTests( { name: 'get state before calling http_request', test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor['get_state'](); @@ -62,7 +62,7 @@ export function generateTests( { name: 'get state after calling http_request', test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor['get_state'](); diff --git a/examples/experimental/test/property/candid_rpc/canister_methods/init/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/canister_methods/init/test/generate_tests.ts index 7cc3865499..5cde0888b6 100644 --- a/examples/experimental/test/property/candid_rpc/canister_methods/init/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/canister_methods/init/test/generate_tests.ts @@ -17,7 +17,7 @@ export function generateTests( { name: `init method`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor.getInitValues(); return testEquality(result, expectedResult); diff --git a/examples/experimental/test/property/candid_rpc/canister_methods/inspect_message/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/canister_methods/inspect_message/test/generate_tests.ts index ddfeb1baf2..7502996ae5 100644 --- a/examples/experimental/test/property/candid_rpc/canister_methods/inspect_message/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/canister_methods/inspect_message/test/generate_tests.ts @@ -43,7 +43,7 @@ function generateTest( name: `method "${functionName}" expected ${behavior}`, test: async (): Promise => { await agent.fetchRootKey(); - const actor = getActor(__dirname, agent); + const actor = await getActor(__dirname, agent); try { const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/canister_methods/query/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/canister_methods/query/test/generate_tests.ts index 3f03f5b327..5ac5f31add 100644 --- a/examples/experimental/test/property/candid_rpc/canister_methods/query/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/canister_methods/query/test/generate_tests.ts @@ -19,7 +19,7 @@ export function generateTests( { name: `query method "${functionName}"`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); return testEquality(result, expectedResult); } diff --git a/examples/experimental/test/property/candid_rpc/canister_methods/update/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/canister_methods/update/test/generate_tests.ts index f822f5fefe..6720c4c77f 100644 --- a/examples/experimental/test/property/candid_rpc/canister_methods/update/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/canister_methods/update/test/generate_tests.ts @@ -19,7 +19,7 @@ export function generateTests( { name: `update method "${functionName}"`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); return testEquality(result, expectedResult); diff --git a/examples/experimental/test/property/candid_rpc/float32/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/float32/test/generate_tests.ts index 8d06ffb8c1..ab28fd4159 100644 --- a/examples/experimental/test/property/candid_rpc/float32/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/float32/test/generate_tests.ts @@ -19,7 +19,7 @@ export function generateTests( { name: `float32 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/float64/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/float64/test/generate_tests.ts index a1b96c9d69..0bb2db14e0 100644 --- a/examples/experimental/test/property/candid_rpc/float64/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/float64/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `float64 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/func/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/func/test/generate_tests.ts index 6f43b31d48..0d2cf20228 100644 --- a/examples/experimental/test/property/candid_rpc/func/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/func/test/generate_tests.ts @@ -13,7 +13,7 @@ export function generateTests( { name: `func ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamFuncs.map( diff --git a/examples/experimental/test/property/candid_rpc/int/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/int/test/generate_tests.ts index d371cab3d8..22f52c4c50 100644 --- a/examples/experimental/test/property/candid_rpc/int/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/int/test/generate_tests.ts @@ -20,7 +20,7 @@ export function generateTests( { name: `int ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/int16/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/int16/test/generate_tests.ts index ca7736f384..c5e5f9b20b 100644 --- a/examples/experimental/test/property/candid_rpc/int16/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/int16/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `int16 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/int32/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/int32/test/generate_tests.ts index aca24d4e9e..5a500004c9 100644 --- a/examples/experimental/test/property/candid_rpc/int32/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/int32/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `int32 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/int64/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/int64/test/generate_tests.ts index d4c9ee1e05..ade85e0c06 100644 --- a/examples/experimental/test/property/candid_rpc/int64/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/int64/test/generate_tests.ts @@ -22,7 +22,7 @@ export function generateTests( { name: `int64 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/int8/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/int8/test/generate_tests.ts index 2895ddb7b8..6033e52f41 100644 --- a/examples/experimental/test/property/candid_rpc/int8/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/int8/test/generate_tests.ts @@ -22,7 +22,7 @@ export function generateTests( { name: `test ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/nat/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/nat/test/generate_tests.ts index 88de4ee05b..5bb7c56794 100644 --- a/examples/experimental/test/property/candid_rpc/nat/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/nat/test/generate_tests.ts @@ -20,7 +20,7 @@ export function generateTests( { name: `nat ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/nat16/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/nat16/test/generate_tests.ts index 8830422ece..ecca58df70 100644 --- a/examples/experimental/test/property/candid_rpc/nat16/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/nat16/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `nat16 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/nat32/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/nat32/test/generate_tests.ts index cb3c408713..a535493371 100644 --- a/examples/experimental/test/property/candid_rpc/nat32/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/nat32/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `nat32 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/nat64/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/nat64/test/generate_tests.ts index 0c1b787e13..fbd38252d4 100644 --- a/examples/experimental/test/property/candid_rpc/nat64/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/nat64/test/generate_tests.ts @@ -22,7 +22,7 @@ export function generateTests( { name: `nat64 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/nat8/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/nat8/test/generate_tests.ts index 00b271b245..f174bd5e2d 100644 --- a/examples/experimental/test/property/candid_rpc/nat8/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/nat8/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `nat8 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/null/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/null/test/generate_tests.ts index b768bdc13a..57944c1b50 100644 --- a/examples/experimental/test/property/candid_rpc/null/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/null/test/generate_tests.ts @@ -12,7 +12,7 @@ export function generateTests( { name: `test ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamNulls.map( diff --git a/examples/experimental/test/property/candid_rpc/opt/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/opt/test/generate_tests.ts index 8061de7166..9ff9e2ecdd 100644 --- a/examples/experimental/test/property/candid_rpc/opt/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/opt/test/generate_tests.ts @@ -15,7 +15,7 @@ export function generateTests( { name: `opt ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const params = namedParamOpts.map( (param) => param.value.value.agentArgumentValue diff --git a/examples/experimental/test/property/candid_rpc/principal/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/principal/test/generate_tests.ts index fad105f8fb..33707ce3f9 100644 --- a/examples/experimental/test/property/candid_rpc/principal/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/principal/test/generate_tests.ts @@ -18,7 +18,7 @@ export function generateTests( { name: `principal ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamPrincipals.map( (param) => param.value.value.agentArgumentValue diff --git a/examples/experimental/test/property/candid_rpc/record/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/record/test/generate_tests.ts index dbcbc2348a..aba1af3919 100644 --- a/examples/experimental/test/property/candid_rpc/record/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/record/test/generate_tests.ts @@ -13,7 +13,7 @@ export function generateTests( { name: `record ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamRecords.map( diff --git a/examples/experimental/test/property/candid_rpc/recursive/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/recursive/test/generate_tests.ts index f051ae2125..7b7d82fb7a 100644 --- a/examples/experimental/test/property/candid_rpc/recursive/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/recursive/test/generate_tests.ts @@ -13,7 +13,7 @@ export function generateTests( { name: `recursive ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const params = namedParamRecursive.map( (param) => param.value.value.agentArgumentValue diff --git a/examples/experimental/test/property/candid_rpc/text/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/text/test/generate_tests.ts index 864fad0251..50693f97c9 100644 --- a/examples/experimental/test/property/candid_rpc/text/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/text/test/generate_tests.ts @@ -20,7 +20,7 @@ export function generateTests( { name: `text ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/experimental/test/property/candid_rpc/tuple/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/tuple/test/generate_tests.ts index 387be4ae21..2b2fa75e24 100644 --- a/examples/experimental/test/property/candid_rpc/tuple/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/tuple/test/generate_tests.ts @@ -18,7 +18,7 @@ export function generateTests( { name: `tuple ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamTuples.map( diff --git a/examples/experimental/test/property/candid_rpc/variant/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/variant/test/generate_tests.ts index 540ee8ead8..7aea8d7578 100644 --- a/examples/experimental/test/property/candid_rpc/variant/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/variant/test/generate_tests.ts @@ -15,7 +15,7 @@ export function generateTests( { name: `variant ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamVariants.map( diff --git a/examples/experimental/test/property/candid_rpc/vec/test/generate_tests.ts b/examples/experimental/test/property/candid_rpc/vec/test/generate_tests.ts index 682face3fd..0698290527 100644 --- a/examples/experimental/test/property/candid_rpc/vec/test/generate_tests.ts +++ b/examples/experimental/test/property/candid_rpc/vec/test/generate_tests.ts @@ -14,7 +14,7 @@ export function generateTests( { name: `vec ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const params = namedParamVecs.map( (param) => param.value.value.agentArgumentValue diff --git a/examples/stable/test/property/candid_rpc/blob/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/blob/test/generate_tests.ts index 486dfabddd..4d2d17aef4 100644 --- a/examples/stable/test/property/candid_rpc/blob/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/blob/test/generate_tests.ts @@ -21,7 +21,7 @@ export function generateTests( { name: `blob ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...paramBlobs.map( diff --git a/examples/stable/test/property/candid_rpc/bool/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/bool/test/generate_tests.ts index f502a7d3d1..7f0a73a99f 100644 --- a/examples/stable/test/property/candid_rpc/bool/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/bool/test/generate_tests.ts @@ -20,7 +20,7 @@ export function generateTests( { name: `bool ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/canister_methods/http_request_update/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/canister_methods/http_request_update/test/generate_tests.ts index 7b0a90a19b..597741596a 100644 --- a/examples/stable/test/property/candid_rpc/canister_methods/http_request_update/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/canister_methods/http_request_update/test/generate_tests.ts @@ -22,7 +22,7 @@ export function generateTests( { name: 'get state before calling http_request', test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor['get_state'](); @@ -62,7 +62,7 @@ export function generateTests( { name: 'get state after calling http_request', test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor['get_state'](); diff --git a/examples/stable/test/property/candid_rpc/canister_methods/init/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/canister_methods/init/test/generate_tests.ts index 7cc3865499..5cde0888b6 100644 --- a/examples/stable/test/property/candid_rpc/canister_methods/init/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/canister_methods/init/test/generate_tests.ts @@ -17,7 +17,7 @@ export function generateTests( { name: `init method`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor.getInitValues(); return testEquality(result, expectedResult); diff --git a/examples/stable/test/property/candid_rpc/canister_methods/inspect_message/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/canister_methods/inspect_message/test/generate_tests.ts index ddfeb1baf2..7502996ae5 100644 --- a/examples/stable/test/property/candid_rpc/canister_methods/inspect_message/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/canister_methods/inspect_message/test/generate_tests.ts @@ -43,7 +43,7 @@ function generateTest( name: `method "${functionName}" expected ${behavior}`, test: async (): Promise => { await agent.fetchRootKey(); - const actor = getActor(__dirname, agent); + const actor = await getActor(__dirname, agent); try { const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/canister_methods/query/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/canister_methods/query/test/generate_tests.ts index 3f03f5b327..5ac5f31add 100644 --- a/examples/stable/test/property/candid_rpc/canister_methods/query/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/canister_methods/query/test/generate_tests.ts @@ -19,7 +19,7 @@ export function generateTests( { name: `query method "${functionName}"`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); return testEquality(result, expectedResult); } diff --git a/examples/stable/test/property/candid_rpc/canister_methods/update/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/canister_methods/update/test/generate_tests.ts index f822f5fefe..6720c4c77f 100644 --- a/examples/stable/test/property/candid_rpc/canister_methods/update/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/canister_methods/update/test/generate_tests.ts @@ -19,7 +19,7 @@ export function generateTests( { name: `update method "${functionName}"`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); return testEquality(result, expectedResult); diff --git a/examples/stable/test/property/candid_rpc/float32/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/float32/test/generate_tests.ts index 8d06ffb8c1..ab28fd4159 100644 --- a/examples/stable/test/property/candid_rpc/float32/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/float32/test/generate_tests.ts @@ -19,7 +19,7 @@ export function generateTests( { name: `float32 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/float64/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/float64/test/generate_tests.ts index a1b96c9d69..0bb2db14e0 100644 --- a/examples/stable/test/property/candid_rpc/float64/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/float64/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `float64 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/func/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/func/test/generate_tests.ts index 6f43b31d48..0d2cf20228 100644 --- a/examples/stable/test/property/candid_rpc/func/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/func/test/generate_tests.ts @@ -13,7 +13,7 @@ export function generateTests( { name: `func ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamFuncs.map( diff --git a/examples/stable/test/property/candid_rpc/int/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/int/test/generate_tests.ts index d371cab3d8..22f52c4c50 100644 --- a/examples/stable/test/property/candid_rpc/int/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/int/test/generate_tests.ts @@ -20,7 +20,7 @@ export function generateTests( { name: `int ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/int16/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/int16/test/generate_tests.ts index ca7736f384..c5e5f9b20b 100644 --- a/examples/stable/test/property/candid_rpc/int16/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/int16/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `int16 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/int32/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/int32/test/generate_tests.ts index aca24d4e9e..5a500004c9 100644 --- a/examples/stable/test/property/candid_rpc/int32/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/int32/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `int32 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/int64/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/int64/test/generate_tests.ts index d4c9ee1e05..ade85e0c06 100644 --- a/examples/stable/test/property/candid_rpc/int64/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/int64/test/generate_tests.ts @@ -22,7 +22,7 @@ export function generateTests( { name: `int64 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/int8/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/int8/test/generate_tests.ts index 2895ddb7b8..6033e52f41 100644 --- a/examples/stable/test/property/candid_rpc/int8/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/int8/test/generate_tests.ts @@ -22,7 +22,7 @@ export function generateTests( { name: `test ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/nat/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/nat/test/generate_tests.ts index 88de4ee05b..5bb7c56794 100644 --- a/examples/stable/test/property/candid_rpc/nat/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/nat/test/generate_tests.ts @@ -20,7 +20,7 @@ export function generateTests( { name: `nat ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/nat16/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/nat16/test/generate_tests.ts index 8830422ece..ecca58df70 100644 --- a/examples/stable/test/property/candid_rpc/nat16/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/nat16/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `nat16 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/nat32/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/nat32/test/generate_tests.ts index cb3c408713..a535493371 100644 --- a/examples/stable/test/property/candid_rpc/nat32/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/nat32/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `nat32 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/nat64/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/nat64/test/generate_tests.ts index 0c1b787e13..fbd38252d4 100644 --- a/examples/stable/test/property/candid_rpc/nat64/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/nat64/test/generate_tests.ts @@ -22,7 +22,7 @@ export function generateTests( { name: `nat64 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/nat8/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/nat8/test/generate_tests.ts index 00b271b245..f174bd5e2d 100644 --- a/examples/stable/test/property/candid_rpc/nat8/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/nat8/test/generate_tests.ts @@ -23,7 +23,7 @@ export function generateTests( { name: `nat8 ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/null/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/null/test/generate_tests.ts index b768bdc13a..57944c1b50 100644 --- a/examples/stable/test/property/candid_rpc/null/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/null/test/generate_tests.ts @@ -12,7 +12,7 @@ export function generateTests( { name: `test ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamNulls.map( diff --git a/examples/stable/test/property/candid_rpc/opt/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/opt/test/generate_tests.ts index 8061de7166..9ff9e2ecdd 100644 --- a/examples/stable/test/property/candid_rpc/opt/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/opt/test/generate_tests.ts @@ -15,7 +15,7 @@ export function generateTests( { name: `opt ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const params = namedParamOpts.map( (param) => param.value.value.agentArgumentValue diff --git a/examples/stable/test/property/candid_rpc/principal/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/principal/test/generate_tests.ts index fad105f8fb..33707ce3f9 100644 --- a/examples/stable/test/property/candid_rpc/principal/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/principal/test/generate_tests.ts @@ -18,7 +18,7 @@ export function generateTests( { name: `principal ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamPrincipals.map( (param) => param.value.value.agentArgumentValue diff --git a/examples/stable/test/property/candid_rpc/record/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/record/test/generate_tests.ts index dbcbc2348a..aba1af3919 100644 --- a/examples/stable/test/property/candid_rpc/record/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/record/test/generate_tests.ts @@ -13,7 +13,7 @@ export function generateTests( { name: `record ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamRecords.map( diff --git a/examples/stable/test/property/candid_rpc/recursive/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/recursive/test/generate_tests.ts index f051ae2125..7b7d82fb7a 100644 --- a/examples/stable/test/property/candid_rpc/recursive/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/recursive/test/generate_tests.ts @@ -13,7 +13,7 @@ export function generateTests( { name: `recursive ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const params = namedParamRecursive.map( (param) => param.value.value.agentArgumentValue diff --git a/examples/stable/test/property/candid_rpc/text/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/text/test/generate_tests.ts index 864fad0251..50693f97c9 100644 --- a/examples/stable/test/property/candid_rpc/text/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/text/test/generate_tests.ts @@ -20,7 +20,7 @@ export function generateTests( { name: `text ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName](...paramValues); diff --git a/examples/stable/test/property/candid_rpc/tuple/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/tuple/test/generate_tests.ts index 387be4ae21..2b2fa75e24 100644 --- a/examples/stable/test/property/candid_rpc/tuple/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/tuple/test/generate_tests.ts @@ -18,7 +18,7 @@ export function generateTests( { name: `tuple ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamTuples.map( diff --git a/examples/stable/test/property/candid_rpc/variant/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/variant/test/generate_tests.ts index 540ee8ead8..7aea8d7578 100644 --- a/examples/stable/test/property/candid_rpc/variant/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/variant/test/generate_tests.ts @@ -15,7 +15,7 @@ export function generateTests( { name: `variant ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const result = await actor[functionName]( ...namedParamVariants.map( diff --git a/examples/stable/test/property/candid_rpc/vec/test/generate_tests.ts b/examples/stable/test/property/candid_rpc/vec/test/generate_tests.ts index 682face3fd..0698290527 100644 --- a/examples/stable/test/property/candid_rpc/vec/test/generate_tests.ts +++ b/examples/stable/test/property/candid_rpc/vec/test/generate_tests.ts @@ -14,7 +14,7 @@ export function generateTests( { name: `vec ${functionName}`, test: async (): Promise => { - const actor = getActor(__dirname); + const actor = await getActor(__dirname); const params = namedParamVecs.map( (param) => param.value.value.agentArgumentValue diff --git a/test/get_canister_actor.ts b/test/get_canister_actor.ts index 6fe9a12fb2..a0e74735ea 100644 --- a/test/get_canister_actor.ts +++ b/test/get_canister_actor.ts @@ -31,11 +31,5 @@ export async function getCanisterActor( agent }); - if (typeof canisterName === 'string') { - throw new Error( - 'This prop tests uses getCanisterActor and is good to go' - ); - } - return actor; }