import { describe, test, expect } from 'bun:test'; import { FetchRepoFile } from './index'; describe('FetchFromRepo', async () => { const prefix = 'https://raw.githubusercontent.com/ethereum-lists/4bytes/master/signatures/'; test('Test fetch 4bytes', async () => { const fourBytes = new FetchRepoFile(prefix); const signature = await fourBytes.call('a9059cbb'); expect(signature).toBe('transfer(address,uint256)'); }); test('Set cache', async () => { const fourBytes = new FetchRepoFile(prefix); await fourBytes.call('a9059cbb'); expect(fourBytes.map.size).toBe(1); }); });