Unit-test the shipped frontend JavaScript with standard JS tooling (vitest)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- github-actions, javascript, node.js, python
Línea de trabajo
Read the pending work and related issues #7609 and #7610 first: the suite depends on which branch lands first and must be reconciled into one package.json, lockfile, and CI job. The issue names tests/js/, reflex_base/frontend/tests/, vitest.config.js, AGENTS.md, and unit_tests.yml as the relevant entry points. Done means Vitest with jsdom tests the shipped JavaScript, runs through a gated CI job, and is documented; the existing runtime scripts are a follow-up.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
The JavaScript Reflex ships to every app (state.js, react-theme.js, upload.js, client state, the helpers and components under .templates/web/utils/) has no test suite of its own. Its behavior is only reachable through compiled output: Python unit tests can assert on generated source but not on runtime behavior, and Playwright integration tests are slow and indirect for things like provider teardown, SSR-versus-client branches, subscription bookkeeping, reconnect backoff or event-queue ordering. The two existing runtime checks (tests/units/compiler/state_js.test.mjs, tests/units/reflex_base/client_event_queue_runtime.mjs) are bespoke node scripts driven from pytest.
Proposal
Test the shipped JS with standard tooling: vitest + jsdom, with its own package.json and a committed package-lock.json, installed with npm ci and run as a js-unit-tests job in unit_tests.yml that blocks merges through unit-tests-gate.
- Tests must not live inside the template tree that
reflex initcopies verbatim into a user's.web. While the runtime is still a template tree they live intests/js/and resolve$/...through a vitest alias; once the runtime ships as a package (#7609) they move into the package atreflex_base/frontend/tests/. $/utils/statehas to be stubbed today because the real module imports socket.io, react-router and the per-app generatedutils/context.js. Decoupling the runtime from generated artifacts (part of #7609) makesstate.jsitself unit-testable.- Where JS and Python share a constant (for example the client-state registry key in
constants/state.py, or the_downloadpayload matcher instate.jsversus the Var's_js_expr), a test asserts the two definitions agree so they cannot drift. - Document the suite, and when to reach for it versus Playwright, in
AGENTS.md(npm --prefix tests/js ci && npm --prefix tests/js test). - New JS test files are formatted with biome under pre-commit; codespell skips committed lockfiles.
Pending work
- #6936 (ClientStateVar refactor, #7610) introduces
tests/js/:vitest.config.js,client_state.test.js, thejs-unit-testsCI job and its gate wiring, and theAGENTS.mdsection. - The npm package branch for #7609 adds
reflex_base/frontend/tests/withstate.test.js,runtime.test.jsandhelpers.test.js, and makesstate.jsimportable in tests. - Land the suite with whichever of the two merges first, then reconcile the other so there is one
package.json/lockfile and one CI job. - Follow-up: fold the existing
.mjsruntime checks into the vitest suite so there is a single JS test entry point.
Related
- #7609 installable npm package
- #7610 ClientStateVar refactor (#6936)
- Lenguaje dominante
- Python
- Estrellas
- 29k
- Forks
- 1.8k
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 143
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de reflex-dev/reflex
-
Operations on a list[T] | None var throw when the value is NonePosiblemente ocupada @masenf la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
reflex-dev/reflex#7826 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
A dev run stopped before its backend loads leaves .web/nocompile, so the next run or export skips the compilePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
reflex-dev/reflex#7825 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
PropsBase nested serialization applies parent include/exclude filters to child fieldsPosiblemente ocupada @harsh21234i la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
reflex-dev/reflex#7787 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
OTel: add trace_flags to JSON log records so unsampled trace ids are recognizablePosiblemente ocupada @ShaanGS la tomó hace 7 días. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
reflex-dev/reflex#7729 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
0.9.12 changelog follow-ups: the #7132 "_get_was_touched" entry describes unreachable behaviour, #7115's hasattr/getattr change is undocumented, #7131's wordingQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
reflex-dev/reflex#7260 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de reflex-dev/reflex
Issues similares
-
release
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
MichaelYcJo/SpecSeal#1535 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
valentinfrlch/ha-llmvision#769 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
daniel-ospina/tortoise#11937 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
good first issue help wanted python up-for-grabs
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
andrewsiah/agentswarm-data-tasks#238 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
cadence-workflow/cadence-ai-samples#175 ·
Los mantenedores suelen responder en 1 día