Skip to content

Commit

Permalink
await get actor
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Dec 20, 2024
1 parent 2097d15 commit a3672a6
Show file tree
Hide file tree
Showing 24 changed files with 54 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function generateTests(
{
name: `init method`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const initValues = await actor.getInitValues();
const isPostUpgradeCalled =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function generateTests(
{
name: `post upgrade method`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const postUpgradeValues =
await actor.getPostUpgradeValues();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function generateGetPreUpgradeExecutedCanisterMethod(): QueryMethod {
{
name: `pre upgrade was not called after first deploy`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);
const result = await actor.getPreUpgradeExecuted();

return testEquality(result, []);
Expand All @@ -135,7 +135,7 @@ function generateGetPreUpgradeExecutedCanisterMethod(): QueryMethod {
{
name: `pre upgrade was called after second deploy`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);
const result = await actor.getPreUpgradeExecuted();

return testEquality(result, [true]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function generateTests(
{
name: `containsKey after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand All @@ -68,7 +68,7 @@ function generateTests(
{
name: `containsKey after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand All @@ -82,7 +82,7 @@ function generateTests(
{
name: `containsKey after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function generateTests(
{
name: `get after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand All @@ -86,7 +86,7 @@ function generateTests(
{
name: `get after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand All @@ -102,7 +102,7 @@ function generateTests(
{
name: `get after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function generateTests(
{
name: `insert after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function generateTests(functionName: string): Test[][] {
{
name: `isEmpty after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -56,7 +56,7 @@ function generateTests(functionName: string): Test[][] {
{
name: `isEmpty after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -68,7 +68,7 @@ function generateTests(functionName: string): Test[][] {
{
name: `isEmpty after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function generateTests(
{
name: `items after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -71,7 +71,7 @@ function generateTests(
{
name: `items after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -88,7 +88,7 @@ function generateTests(
{
name: `items after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function generateTests(
{
name: `keys after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -77,7 +77,7 @@ function generateTests(
{
name: `keys after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -96,7 +96,7 @@ function generateTests(
{
name: `keys after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function generateTests(functionName: string): Test[][] {
{
name: `len after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -57,7 +57,7 @@ function generateTests(functionName: string): Test[][] {
{
name: `len after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -69,7 +69,7 @@ function generateTests(functionName: string): Test[][] {
{
name: `len after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function generateTests(
{
name: `remove after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function generateTests(
{
name: `values after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -80,7 +80,7 @@ function generateTests(
{
name: `values after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -99,7 +99,7 @@ function generateTests(
{
name: `values after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function generateTests(
{
name: `init method`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const initValues = await actor.getInitValues();
const isPostUpgradeCalled =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function generateTests(
{
name: `post upgrade method`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const postUpgradeValues =
await actor.getPostUpgradeValues();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function generateGetPreUpgradeExecutedCanisterMethod(): QueryMethod {
{
name: `pre upgrade was not called after first deploy`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);
const result = await actor.getPreUpgradeExecuted();

return testEquality(result, []);
Expand All @@ -129,7 +129,7 @@ function generateGetPreUpgradeExecutedCanisterMethod(): QueryMethod {
{
name: `pre upgrade was called after second deploy`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);
const result = await actor.getPreUpgradeExecuted();

return testEquality(result, [true]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function generateTests(
{
name: `containsKey after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand All @@ -93,7 +93,7 @@ function generateTests(
{
name: `containsKey after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand All @@ -107,7 +107,7 @@ function generateTests(
{
name: `containsKey after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function generateTests(
{
name: `get after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand All @@ -95,7 +95,7 @@ function generateTests(
{
name: `get after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand All @@ -111,7 +111,7 @@ function generateTests(
{
name: `get after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function generateTests(
{
name: `insert after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName](
keySampleAgentArgumentValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function generateTests(functionName: string): Test[][] {
{
name: `isEmpty after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -57,7 +57,7 @@ function generateTests(functionName: string): Test[][] {
{
name: `isEmpty after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -69,7 +69,7 @@ function generateTests(functionName: string): Test[][] {
{
name: `isEmpty after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function generateTests(
{
name: `items after first deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -72,7 +72,7 @@ function generateTests(
{
name: `items after second deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand All @@ -89,7 +89,7 @@ function generateTests(
{
name: `items after third deploy ${functionName}`,
test: async (): Promise<AzleResult> => {
const actor = getActor(__dirname);
const actor = await getActor(__dirname);

const result = await actor[functionName]();

Expand Down
Loading

0 comments on commit a3672a6

Please sign in to comment.