// Read-only audit of the full Dummy through the normal Results presentation and Excel exporter. import { build } from 'esbuild'; import { mkdir, writeFile, readFile } from 'node:fs/promises'; import { pathToFileURL } from 'node:url'; import { resolve } from 'node:path'; const previous=await readFile('tests/dummy-results-audit.mjs','utf8'); const loader=previous.split('contents: `')[1].split('const dataset=workspace.dataset;')[0]; const source=`${loader} import React from 'react';import {renderToStaticMarkup} from 'react-dom/server'; import {JSDOM} from 'jsdom';import {read,utils} from 'xlsx'; import {FloatingResultsWindow} from './src/features/linked-results/FloatingResultsWindow'; import {resultSectionsFor} from './src/features/linked-results/result-message'; import {resultsExcelContent} from './src/features/linked-results/results-excel-content'; import {buildResultsWindowExcel} from './src/exports/results-window-excel'; const dom=new JSDOM('
'); Object.assign(globalThis,{window:dom.window,document:dom.window.document,DOMParser:dom.window.DOMParser,Node:dom.window.Node}); const counts={};let maxRows=0; for(const sheet of workspace.dataset.sheets.filter(s=>s.isProjectSheet))for(const record of sheet.analysis.records){ const tool=toolIdForRecord(record,sheet.toolId);const sheets=recordResultSheets(record,workspace.dataset.sheets,sheet.id,tool);const sections=resultSectionsFor(record,tool); if(!sheets.length&&!sections.length)continue; const before=JSON.stringify({sheets,sections}); const html=renderToStaticMarkup(