()
| 36 | const FIXTURES_DIR = resolve(__dirname, 'fixtures'); |
| 37 | |
| 38 | async function loadWasm(): Promise<WasmReconstructionWrapper> { |
| 39 | const factory = resolveColmapWasmFactory(await import(pathToFileURL(WASM_JS).href)); |
| 40 | const wasmBinary = readFileSync(WASM_BIN); |
| 41 | const module = await factory({ |
| 42 | wasmBinary, |
| 43 | locateFile: (f) => resolve(ROOT, 'public/wasm', f), |
| 44 | }); |
| 45 | const wrapper = new WasmReconstructionWrapper(); |
| 46 | Reflect.set(wrapper, 'module', module); |
| 47 | Reflect.set(wrapper, 'reconstruction', new module.Reconstruction()); |
| 48 | return wrapper; |
| 49 | } |
| 50 | |
| 51 | function toAB(path: string): ArrayBuffer { |
| 52 | const bytes = readFileSync(path); |
no test coverage detected