Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions yarn-project/ethereum/src/test/start_anvil.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { times } from '@aztec/foundation/collection';

import { createPublicClient, http } from 'viem';

import { startAnvil } from './start_anvil.js';
Expand All @@ -22,4 +24,11 @@ describe('start_anvil', () => {
await anvil.stop();
expect(anvil.status).toEqual('idle');
});

it('does not reuse ports when starting multiple instances', async () => {
const anvils = await Promise.all(times(20, () => startAnvil()));
const ports = anvils.map(({ rpcUrl }) => parseInt(new URL(rpcUrl).port));
expect(new Set(ports).size).toEqual(20);
await Promise.all(anvils.map(({ anvil }) => anvil.stop()));
});
});
Loading