import { describe, expect, it } from 'vitest'; import { ConnectorMetaSchema } from '@rareindex/connectors'; import metaJson from './meta.json' with { type: 'json' }; import { listFixtures, loadFixture, runFixtureSuite } from '@rareindex/connectors/testing'; import createConnector from './index.js'; // meta.json is read directly so the suite does not depend on connectors/registry.json being regenerated. const connector = createConnector(ConnectorMetaSchema.parse(metaJson)); describe('hypeboost', () => { runFixtureSuite(connector, it, expect); it('normalises the first fixture into catalog_item records with the expected fields', async () => { const [name] = listFixtures('hypeboost'); const fx = loadFixture('hypeboost', name!); const out = await connector.normalize(fx.raw); expect(out.length).toBeGreaterThan(0); const ask = out.find((r) => r.kind === 'listing'); if (ask?.kind !== 'listing') throw new Error('no listing'); expect(ask.currency).toBe('EUR'); expect(ask.price).toBeGreaterThan(20); expect(ask.attributes.identifiers.hypeboost_id).toMatch(/^\d+$/); expect(ask.sourceUrl).toMatch(/hypeboost\.com\/en\/product\//); }); });