Skip to content

Commit

Permalink
hashpool: Ensure we can handle hosts that don't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbetz committed Nov 21, 2022
1 parent a458d8a commit b834de6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions __tests__/hashpool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ describe( 'hashpool', () => {

await pool.end();
} );

it( 'should handle hosts that do not exist', async () => {
const pool = new HashPool( [ 'invalid-host' ] );
await pool.end();
} );

it( 'should return false if there are no hosts', async () => {
const pool = new HashPool( [ 'invalid-host' ] );
expect( pool.get( 'invalid-host' ) ).resolves.toBe( false );
await pool.end();
} );
} );

describe( 'basic ops', () => {
Expand Down

0 comments on commit b834de6

Please sign in to comment.