feat: add a built-output smoke test command (`nuxt preview --smoke`)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 45/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- bun, node.js, typescript
Piste de recherche
Read the existing nuxt preview command and the described ~550-line Bun smoke script to map how the built server is started and checked. Then trace how the CLI resolves the .output entry and handles environment and signals across runtimes. Done means a smoke command checks HTTP expectations and shutdown, exits nonzero on failure, and leaves no server process running.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
nuxt preview starts .output/server/index.mjs, but it does not verify that the built output:
- boots with the production environment,
- serves the shell and all required assets/chunks,
- starts with the intended runtime (Bun or Node),
- runs Nitro
closehooks and exits cleanly onSIGTERM/SIGINT.
nuxt build can pass while the deploy fails at runtime: a missing secret, a wrong database path, a missing asset, a preset regression (for example the Bun preset skipping close hooks), or a shutdown that hangs. We currently maintain a ~550-line smoke script for this.
What our script does:
- reserves a free port, creates temporary SQLite databases, and applies migrations;
- builds a minimal environment instead of inheriting the developer
.env; - spawns
.output/server/index.mjswith Bun; - waits for HTTP 200 and a known shell marker, and scans captured logs for forbidden content;
- sends
SIGTERM, asserts exit within 15 seconds and clean shutdown; on Windows it records that Bun'sSIGTERMis termination-only; - is the last step of
check -> build -> built-output Playwright -> smoke.
Proposal: nuxt preview --smoke (or nuxt build --smoke) with:
--url/--expectfor a path plus expected status and optional body marker;--timeoutand--signal;--env-fileor--envfor a minimal production environment;- an assertion that the process exits after the signal, optionally checking a close-hook marker;
- a non-zero exit on failure, and no server process left behind;
- support for the current runtime and
.outputlayout without hard-coding Nitro internals.
What exists today:
nuxt previewstarts the server but makes no assertions.@nuxt/test-utilsis excellent for tests that call the server, but it does not own the built process lifecycle or shutdown assertions.- Nitro close hooks are usually tested manually or with a custom script.
This could be a module, but a CLI command is the right home because it must know the output entry, environment loading and signal semantics. Happy to contribute the command or a shared helper. Our script is Bun-specific today; cross-platform signal handling is the main design work.
Additional information
- Would you be willing to help implement this feature?
- Could this feature be implemented as a module?
- Langage dominant
- TypeScript
- Étoiles
- 402
- Forks
- 125
- Merge moyen
- 2 j 9 h
- PR mergées (30 j)
- 37
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de nuxt/cli
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
nuxt/cli#1677 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
dev: false "reachable from the network" warning when `devServer.host` is a `*.localhost` subdomainPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
nuxt/cli#1644 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
nuxt/cli#1670 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Issues similaires
-
bug priority: low role: BE stage: now
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
ahmadrosid/nakama#2594 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
milind-soni/OpenMausBot#6495 ·
Les mainteneurs répondent en général sous 1 jour
-
Navigating the session tree adds the branch's prompts to Up-arrow history againPeut-être pris @acmerfight l’a pris aujourd’hui. Ouverteuntriaged
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
earendil-works/pi#12279 ·
Les mainteneurs répondent en général sous 1 jour
-
approved documentation
Difficulté 1/5 Moins d'une heure Accessibilité débutants 89/100
vitest-dev/vitest#12015 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100