Run oracles in a real browser (Vitest browser mode)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 18/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, playwright
- Bereich
- testing
Rechercherichtung
Start with the imports in oracleProperty (node:async_hooks, node:fs, node:util) and with useOracleClock, then read oracle-gaps/capture-setup.mjs where ORACLE_GAPS_STATE is read through readFileSync. Running a test file under Vitest browser mode should show these failures, such as AsyncLocalStorage is not a constructor. Done means a browser-safe entry imports and runs in browser mode, and the gap check either runs there or is documented as unsupported.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
An oracle for DOM code must run in jsdom today, so its driver supplies the
browser facts that jsdom lacks: layout, scroll positions, the targets where
scroll events fire, ResizeObserver notifications, and computed styles. When
the driver's stand-in and production rest on the same wrong belief about the
browser, the oracle passes, and only a human or a real browser finds the bug.
We hit this three times in one pull request (react-headroom):
- The stand-in notified a
ResizeObserveron any size change. Chrome notifies
a content-box observer only when the content box changes, so a header that
changes only its padding kept a stale height. - The stand-in decided that a body with
overflow-y: autoscrolls itself.
Withhtml { overflow-y: scroll } body { overflow-x: hidden }, Chrome
computes the body'soverflow-yasauto, but the body grows with its
content and the page scrolls. - The stand-in gave a body the viewport's height. In Chrome, a body that does
not scroll itself grows with the page.
We checked each fact by hand in headless Chrome. An oracle that runs in
Chrome would have checked them on every run.
What stops it at 4749f61
oraclePropertyimportsnode:async_hooks(AsyncLocalStoragefor probe
windows),node:fs(appendFileSync) andnode:util(inspect,
isDeepStrictEqual,types). In Vitest browser mode the test file fails
to import:AsyncLocalStorage is not a constructor.- The gap check's setup file (
oracle-gaps/capture-setup.mjs) reads its run
state fromprocess.env.ORACLE_GAPS_STATEwithreadFileSync. In browser
mode, setup files run in the page.
Request
- Let
oraclePropertyanduseOracleClockrun in Vitest browser mode, for
example with a browser-safe entry that replacesAsyncLocalStorage,fs
andutilwith browser equivalents or leaves those features out. - Let
oracle-gapsrun an oracle in browser mode, or document that it cannot,
and recommend a pattern: for example, an oracle that runs in Chrome for its
laws, and the same oracle in jsdom for the gap check.
Workaround we considered
Keep the oracle in Node and drive a Chrome page through Playwright: the
driver sends each history to the page, which runs it against a bundle of
production and returns the observations. This needs a page bundle, a
page-side clock in place of useOracleClock, and two copies of the driver
environment. The gap check still cannot mutate the code in the page.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 5
- Forks
- 1
- Ø Merge
- 8 Std. 31 Min.
- Gemergte PRs (30 T.)
- 60
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/oracles
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TanStack/oracles
Ähnliche Issues
-
Edit: Telemante [YT]Offenchannels:edit check:passed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
fix
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
idean3885/claude-ops-agent#1083 ·
Maintainer antworten meist innerhalb von 1 Tag
-
入群码过期Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
aliyun/ai-agent-handbook#29 · 1 Kommentar ·
-
docs documentation need-triage SaaS
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
apache/cloudstack#14719 ·
Maintainer antworten meist innerhalb von 1 Tag