Skip to content

Commit

Permalink
chore: added tests for getChainExplorer (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer authored Jul 23, 2024
1 parent c609ea5 commit ff8d359
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-coats-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@coinbase/onchainkit": patch
---

-**chore**: Add unit tests for getChainExplorer. By @cpcramer #859
15 changes: 15 additions & 0 deletions src/network/getChainExplorer.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { baseSepolia } from 'viem/chains';
import { describe, expect, it } from 'vitest';
import { getChainExplorer } from './getChainExplorer';

describe('getChainExplorer', () => {
it('should return the correct chain explorer for baseSepolia', () => {
expect(getChainExplorer(baseSepolia.id)).toBe(
'https://sepolia.basescan.org',
);
});

it('should return the default chain explorer for other chains', () => {
expect(getChainExplorer(123)).toBe('https://basescan.org');
});
});

0 comments on commit ff8d359

Please sign in to comment.