
Om MikroORM bug die optreedt bij het persisteren van een kind van een entity met automatisch gegenereerde PK te vermijden.
14 lines
446 B
TypeScript
14 lines
446 B
TypeScript
import fs from 'fs';
|
|
import path from 'node:path';
|
|
import {fileURLToPath} from "node:url";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
/**
|
|
* 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}`));
|
|
}
|