Browse Source

Fix slow warnings for favorites program tests

Mike MacCana 1 year ago
parent
commit
0859912a7e
1 changed files with 5 additions and 3 deletions
  1. 5 3
      basics/favorites/anchor/tests/favorites.ts

+ 5 - 3
basics/favorites/anchor/tests/favorites.ts

@@ -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();
@@ -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'];
@@ -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 {
@@ -75,5 +77,5 @@ describe('Favorites', () => {
       const errorMessage = (error as Error).message;
       assert.isTrue(errorMessage.includes('unknown signer'));
     }
-  });
+  }).slow(4 * SECONDS);
 });