TypeScript 61.9%
HTML 37.2%
SQL 0.7%
1import { describe, expect, it } from 'vitest';2import metaJson from './meta.json' with { type: 'json' };3import { loadFixture, runFixtureSuite } from '@rareindex/connectors/testing';4import { localMeta } from '../../api/_lib/local-meta.js';5import createConnector, { parseErocksDate } from './index.js';67const connector = createConnector(localMeta(metaJson));89describe('e-rocks', () => {10 runFixtureSuite(connector, it, expect);1112 it('parses BST end times and emits live mineral lots in EUR', async () => {13 expect(parseErocksDate('07/09/2026 22:10 BST')).toBe('2026-09-07T21:10:00.000Z');14 const fx = loadFixture('e-rocks', 'auction-p1');15 const out = await connector.normalize(fx.raw);16 expect(out.length).toBeGreaterThan(0);17 for (const r of out) {18 if (r.kind !== 'auction_lot') throw new Error('expected auction_lot');19 expect(r.attributes.categorySlug).toBe('minerals');20 expect(r.attributes.identifiers.erocks_item).toMatch(/^[A-Z0-9]+$/);21 expect(r.auctionHouse).toBe('e-Rocks');22 expect(r.currency).toBe('EUR');23 expect(['live', 'ended']).toContain(r.status);24 }25 expect(out.every((r) => r.kind === 'auction_lot' && r.endsAt instanceof Date)).toBe(true);26 expect(out.some((r) => r.kind === 'auction_lot' && r.location)).toBe(true);27 });28});29