import * as fs from "fs"; const content = fs.readFileSync("C:/ScriptoriumAI/scriptoriumai-ui/src/__tests__/Runboard.telemetry-lockstep-parity.test.tsx", "utf8"); const matches = content.match(/it\([^]*?\}\)/g); // get all `it(...)` blocks. if (matches) { matches.sort((a,b) => b.length - a.length); console.log("Longest `it` length:", matches[0].length); console.log(matches[0].substring(0, 1000)); // Print start of longest }