Skip to content

Commit

Permalink
fix flaky e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes-mysten committed Jan 10, 2025
1 parent ef9f07b commit d9fd37c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/deepbook/test/e2e/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export async function publishPackage(packageName: string, toolbox?: TestToolbox)
throw new Error('Failed to publish package');
}

const { modules, dependencies } = JSON.parse(result.stdout.slice(result.stdout.indexOf('{')));
const { modules, dependencies } = JSON.parse(
result.stdout.slice(result.stdout.indexOf('{'), result.stdout.lastIndexOf('}') + 1),
);

const tx = new Transaction();
const cap = tx.publish({
Expand Down
4 changes: 3 additions & 1 deletion packages/kiosk/test/e2e/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export async function publishPackage(packageName: string, toolbox?: TestToolbox)
throw new Error('Failed to publish package');
}

const { modules, dependencies } = JSON.parse(result.stdout.slice(result.stdout.indexOf('{')));
const { modules, dependencies } = JSON.parse(
result.stdout.slice(result.stdout.indexOf('{'), result.stdout.lastIndexOf('}') + 1),
);

const tx = new Transaction();
const cap = tx.publish({
Expand Down
4 changes: 3 additions & 1 deletion packages/typescript/test/e2e/utils/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ export async function publishPackage(packageName: string, toolbox?: TestToolbox)

let resultJson;
try {
resultJson = JSON.parse(result.stdout.slice(result.stdout.indexOf('{')));
resultJson = JSON.parse(
result.stdout.slice(result.stdout.indexOf('{'), result.stdout.lastIndexOf('}') + 1),
);
} catch (error) {
console.error(result.stdout);
throw new Error('Failed to publish package');
Expand Down

0 comments on commit d9fd37c

Please sign in to comment.