utopia-ia/elffuss-code public
Changesets · Branches · Tags · Compare
| Changeset | 250949a672a80f8914ab12f624fd0ffe1f55b5b1a6cf66e1c26cd7fe18ed3d93 |
|---|---|
| Author | KikoCis <kikocisneros@gmail.com> · 2026-10-11 16:02 +02:00 |
| Committer | KikoCis <kikocisneros@gmail.com> · 2026-10-11 16:02 +02:00 |
| Parents | 4823c78abba4 |
1 file changed
modified tests/mind_stars.mjs +4 −2
| @@ -117,8 +117,10 @@ | ||
| 117 | 117 | return m._debug(); |
| 118 | 118 | }); |
| 119 | 119 | ok('el clic dispara el vuelo (flying=true a mitad de camino)', midFly.flying); |
| 120 | -// que termine (dura 1,1 s de reloj de fotogramas) | |
| 121 | -await p.waitForFunction(async () => !(await import('/js/mind.js'))._debug().flying, null, { timeout: 15000 }).catch(() => {}); | |
| 120 | +// que termine (dura 1,1 s de reloj de fotogramas): se pregunta desde aquí, sin | |
| 121 | +// waitForFunction, que no espera a un predicado asíncrono | |
| 122 | +const vuela = async () => (await p.evaluate(async () => (await import('/js/mind.js'))._debug())).flying; | |
| 123 | +for (let i = 0; i < 150 && await vuela(); i++) await p.waitForTimeout(100); | |
| 122 | 124 | const posAfter = (await p.evaluate(async () => (await import('/js/mind.js'))._debug())).cameraPos; |
| 123 | 125 | const moved = Math.hypot(posAfter[0] - posBefore[0], posAfter[1] - posBefore[1], posAfter[2] - posBefore[2]); |
| 124 | 126 | ok('la cámara realmente se movió al centrarse en el perfil', moved > 5, `desplazamiento ${moved.toFixed(1)}`); |