Skip to content

Commit

Permalink
add throw to find prop tests that don't use this function
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Dec 18, 2024
1 parent ea14a96 commit b7ac42a
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -120,26 +119,9 @@ type GetCanisterActorOptions = {

export async function getCanisterActor<T>(
canisterName: string,
options: GetCanisterActorOptions = {}
_options: GetCanisterActorOptions = {}
): Promise<ActorSubclass<T>> {
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(): {
Expand Down

0 comments on commit b7ac42a

Please sign in to comment.