Skip to content

Commit

Permalink
fix deploy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dOrgJelli committed Jun 7, 2022
1 parent b05c548 commit 4e99974
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/cli/src/__tests__/e2e/deploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const testCaseRoot = path.join(GetPathToCliTestFiles(), "api/deploy");
path.join(testCaseRoot, testCases[index]);

const setup = async (domainNames: string[]) => {
await stopTestEnvironment();
await initTestEnvironment();

const ensAddress = ensAddresses.ensAddress
Expand Down Expand Up @@ -72,7 +73,7 @@ const setup = async (domainNames: string[]) => {
)}`;

for await (const domainName of domainNames) {
await client.invoke<{ hash: string }>({
const result = await client.invoke({
uri: ensWrapperUri,
module: "mutation",
method: "registerDomainAndSubdomainsRecursively",
Expand All @@ -88,6 +89,12 @@ const setup = async (domainNames: string[]) => {
},
},
});

if (result.error) {
throw Error(
`Failed to register ${domainName}: ${result.error.message}`
);
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions packages/js/test-env/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ export const initTestEnvironment = async (cli?: string): Promise<void> => {
`initTestEnvironment failed to start test environment.\nExit Code: ${exitCode}\nStdErr: ${stderr}\nStdOut: ${stdout}`
);
}

// Wait an extra couple of seconds for the ens deployment to finish
await new Promise((resolve) => setTimeout(resolve, 3000));
};

export const stopTestEnvironment = async (cli?: string): Promise<void> => {
Expand Down

0 comments on commit 4e99974

Please sign in to comment.