/** * R2: the horse slice fixture as JSON for the Rust suites (crates/core/tests/fixtures), * written from the TypeScript fixture with `MAKE_R2_ORACLES=1`, asserted otherwise. */ import { readFileSync, writeFileSync } from 'node:fs' import { dirname, resolve } from 'node:path' import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' import { HORSE_MAIN_ASSET_ID, horseSliceInput } from './fixtures/horse-slice' const FILE = resolve( dirname(fileURLToPath(import.meta.url)), '../../../crates/core/tests/fixtures/horse-slice.json', ) describe('horse slice JSON fixture', () => { it('equals the TypeScript lean input', () => { const fixture = { mainAssetId: HORSE_MAIN_ASSET_ID, input: horseSliceInput(), } const text = `${JSON.stringify(fixture, null, 2)}\n` if (process.env.MAKE_R2_ORACLES === '1') writeFileSync(FILE, text) expect(readFileSync(FILE, 'utf8')).toBe(text) }) })