// Bring the wave-five snapshot in line with round 37's two corrections: // the drag probe reads the state behind the module namespace, and the console // trap ignores Chrome's vibrate intervention (synthetic pointer events). const fs = require('fs'); const f = process.argv[process.argv.length - 1] + '/tests/mobile/smoke.mjs'; let s = fs.readFileSync(f, 'utf8'); let done = []; if (s.includes('__ss.pls.current.items')) { s = s.split('__ss.pls.current.items').join('__ss.pls.pls.current.items'); done.push('probe'); } const oldLog = ` cdp.on["Log.entryAdded"] = (p) => { if (p.entry.level === "error") problems.push("LOG " + p.entry.text + " " + (p.entry.url || "")); };`; const newLog = ` cdp.on["Log.entryAdded"] = (p) => { if (p.entry.level !== "error") return; if (/navigator\\.vibrate/.test(p.entry.text || "")) return; problems.push("LOG " + p.entry.text + " " + (p.entry.url || "")); };`; if (s.includes(oldLog)) { s = s.replace(oldLog, () => newLog); done.push('console trap'); } fs.writeFileSync(f, s); console.log('realigned: ' + (done.join(', ') || 'nothing to do'));