Skip to content

Commit

Permalink
add extra debugging info
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Feb 25, 2024
1 parent ec24a1a commit a147696
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/integration/grandExchange.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,25 @@ const sampleBank = new Bank()
.freeze();

async function cancelAllListings(user: TestUser) {
const results: string[] = [];
const activeListings = await global.prisma!.gEListing.findMany({
where: {
user_id: user.id
}
});
for (const listing of activeListings) {
results.push(
(await user.runCommand(geCommand, {
cancel: {
listing: listing.userfacing_id
}
})) as string
);
}
const result = (await user.runCommand(geCommand, {
cancel: {
listing: listing.userfacing_id
}
})) as string;

return results.join('\n');
if (
result !== 'You cannot cancel a listing that has already been fulfilled.' &&
!result.startsWith('Successfully cancelled your listing,')
) {
throw new Error(`Unexpected result from cancelling listing: ${result}`);
}
}
}

describe('Grand Exchange', async () => {
Expand Down

0 comments on commit a147696

Please sign in to comment.