2025SELab2-project-Dwengo/backend/tests/test-utils/load-test-asset.ts
Gerald Schmittinger 202cf4e33c refactor(backend): Streamlining van de testdata voor leerpaden en leerobjecten + integratie in seed
Hierbij ook testdata functionaliteit toegevoegd om makkelijk nieuwe leerpaden aan te maken.
2025-04-15 23:43:30 +02:00

10 lines
310 B
TypeScript

import fs from 'fs';
import path from 'node:path';
/**
* Load the asset at the given path.
* @param relPath Path of the asset relative to the test-assets folder.
*/
export function loadTestAsset(relPath: string): Buffer {
return fs.readFileSync(path.resolve(__dirname, `../test_assets/${relPath}`));
}