Skip to content

Commit

Permalink
Fix slow warnings for favorites program tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemaccana committed Aug 23, 2024
1 parent dc93329 commit 0859912
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions basics/favorites/anchor/tests/favorites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import type { Favorites } from '../target/types/favorites';
import { systemProgramErrors } from './system-errors';
const web3 = anchor.web3;

const SECONDS = 1000;

describe('Favorites', () => {
// Use the cluster and the keypair from Anchor.toml
const provider = anchor.AnchorProvider.env();
Expand Down Expand Up @@ -49,7 +51,7 @@ describe('Favorites', () => {
assert.equal(dataFromPda.number.toString(), favoriteNumber.toString());
// And check the hobbies too
assert.deepEqual(dataFromPda.hobbies, favoriteHobbies);
});
}).slow(4 * SECONDS);

it('Updates the favorites', async () => {
const newFavoriteHobbies = ['skiing', 'skydiving', 'biking', 'swimming'];
Expand All @@ -60,7 +62,7 @@ describe('Favorites', () => {
const customErrorMessage = getCustomErrorMessage(systemProgramErrors, error);
throw new Error(customErrorMessage);
}
});
}).slow(4 * SECONDS);

it('Rejects transactions from unauthorized signers', async () => {
try {
Expand All @@ -75,5 +77,5 @@ describe('Favorites', () => {
const errorMessage = (error as Error).message;
assert.isTrue(errorMessage.includes('unknown signer'));
}
});
}).slow(4 * SECONDS);
});

0 comments on commit 0859912

Please sign in to comment.