18 lines
392 B
TypeScript
18 lines
392 B
TypeScript
|
|
import { readFileSync } from 'node:fs'
|
||
|
|
import { resolve } from 'node:path'
|
||
|
|
|
||
|
|
interface Fixtures {
|
||
|
|
gameId: number
|
||
|
|
runId: number
|
||
|
|
genlockeId: number
|
||
|
|
}
|
||
|
|
|
||
|
|
let cached: Fixtures | null = null
|
||
|
|
|
||
|
|
export function loadFixtures(): Fixtures {
|
||
|
|
if (cached) return cached
|
||
|
|
const raw = readFileSync(resolve(__dirname, '.fixtures.json'), 'utf-8')
|
||
|
|
cached = JSON.parse(raw) as Fixtures
|
||
|
|
return cached
|
||
|
|
}
|