Arnés de pruebas: proveer document al código extraído
El vigía de congelamiento escucha visibilitychange, y el arnés no proveía document: la suite entera se caía al cargar. Fue mi error de proceso además del de código: empujé el commit anterior sin mirar el resultado de la suite, que es exactamente lo que la suite existe para impedir. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
6e5aa16c29
commit
95547bc4f3
@@ -67,7 +67,7 @@ function escenario({ bloqueado = false, msArranque = 20, caida = false } = {}) {
|
|||||||
const beacons = [];
|
const beacons = [];
|
||||||
const sandbox = new Function(
|
const sandbox = new Function(
|
||||||
'window', 'setTimeout', 'setInterval', 'SpeechSynthesisUtterance',
|
'window', 'setTimeout', 'setInterval', 'SpeechSynthesisUtterance',
|
||||||
'localStorage', 'navigator', 'Blob', 'Date',
|
'localStorage', 'navigator', 'Blob', 'Date', 'document',
|
||||||
cuerpo + '; return { anunciarTurno, _uttAncladas };'
|
cuerpo + '; return { anunciarTurno, _uttAncladas };'
|
||||||
);
|
);
|
||||||
const fakeDate = { now: () => t };
|
const fakeDate = { now: () => t };
|
||||||
@@ -77,7 +77,8 @@ function escenario({ bloqueado = false, msArranque = 20, caida = false } = {}) {
|
|||||||
{ getItem: () => '[]', setItem: () => {} },
|
{ getItem: () => '[]', setItem: () => {} },
|
||||||
{ sendBeacon: (u, b) => beacons.push(u) },
|
{ sendBeacon: (u, b) => beacons.push(u) },
|
||||||
function Blob() {},
|
function Blob() {},
|
||||||
Object.assign(function () { return { toISOString: () => '2026-01-01T00:00:00' }; }, { now: () => t })
|
Object.assign(function () { return { toISOString: () => '2026-01-01T00:00:00' }; }, { now: () => t }),
|
||||||
|
{ addEventListener: () => {}, hidden: false }
|
||||||
);
|
);
|
||||||
const correr = (hastaMs) => {
|
const correr = (hastaMs) => {
|
||||||
let n = 0;
|
let n = 0;
|
||||||
@@ -203,12 +204,13 @@ function escenario({ bloqueado = false, msArranque = 20, caida = false } = {}) {
|
|||||||
};
|
};
|
||||||
const api = new Function(
|
const api = new Function(
|
||||||
'window', 'setTimeout', 'setInterval', 'SpeechSynthesisUtterance',
|
'window', 'setTimeout', 'setInterval', 'SpeechSynthesisUtterance',
|
||||||
'localStorage', 'navigator', 'Blob', 'Date',
|
'localStorage', 'navigator', 'Blob', 'Date', 'document',
|
||||||
cuerpo + '; return { anunciarTurno };'
|
cuerpo + '; return { anunciarTurno };'
|
||||||
)({ speechSynthesis: synth }, st, () => {}, Utt,
|
)({ speechSynthesis: synth }, st, () => {}, Utt,
|
||||||
{ getItem: () => '[]', setItem: () => {} },
|
{ getItem: () => '[]', setItem: () => {} },
|
||||||
{ sendBeacon: () => {} }, function Blob() {},
|
{ sendBeacon: () => {} }, function Blob() {},
|
||||||
Object.assign(function () { return { toISOString: () => '2026-01-01T00:00:00' }; }, { now: () => t }));
|
Object.assign(function () { return { toISOString: () => '2026-01-01T00:00:00' }; }, { now: () => t }),
|
||||||
|
{ addEventListener: () => {}, hidden: false });
|
||||||
|
|
||||||
api.anunciarTurno('A01', 'Consultorio 2', 'maría fernanda gómez', () => {});
|
api.anunciarTurno('A01', 'Consultorio 2', 'maría fernanda gómez', () => {});
|
||||||
let n = 0;
|
let n = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user