()
| 46 | const INTEGRITY_TEST_TIMEOUT_MS = 15000; |
| 47 | |
| 48 | async function makeWrapperInNode(): Promise<WasmReconstructionWrapper> { |
| 49 | const factory = resolveColmapWasmFactory(await import(pathToFileURL(WASM_JS).href)); |
| 50 | const wasmBinary = readFileSync(WASM_BIN); |
| 51 | const module = await factory({ |
| 52 | wasmBinary, |
| 53 | locateFile: (f) => resolve(process.cwd(), 'public/wasm', f), |
| 54 | }); |
| 55 | // The wrapper's initialize() calls loadColmapWasm() which fetches; inject |
| 56 | // the Node-loaded module directly. |
| 57 | const wrapper = new WasmReconstructionWrapper(); |
| 58 | Reflect.set(wrapper, 'module', module); |
| 59 | Reflect.set(wrapper, 'reconstruction', new module.Reconstruction()); |
| 60 | return wrapper; |
| 61 | } |
| 62 | |
| 63 | function toAB(path: string): ArrayBuffer { |
| 64 | return copyBytesToArrayBuffer(readFileSync(path)); |
no test coverage detected