Support Rstest static type tests in discovery and run actions

Ouverte
#111 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
38/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
typescript
Domaine
devtools, testing

Piste de recherche

Read the core PR at https://github.com/web-infra-dev/rstest/pull/1984 and the editor contribution guidelines first; the issue does not name editor files or test paths. Add compatibility for the described @rstest/typecheck discovery, run actions, and result mapping, then cover mixed runtime/type projects and the listed limitations in tests against the core PR build before release.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Rstest is adding opt-in type tests through typecheck configuration and the instance API/CLI. The implementation is loaded from the optional @rstest/typecheck package, which must match the core version. Type assertions and lightweight static registration APIs are imported from @rstest/typecheck; core registration imports also remain recognized. This tracks the companion editor compatibility work required by the core repository's contribution guidelines.

The implementation discovers *.test-d.ts / *.spec-d.ts files, statically collects direct describe / test / it calls, and runs the project's compiler without executing the test file. listTests({ includeTaskLocation: true }) returns these cases through the existing ListedTest shape. Reporter case results carry meta.typecheck: true; file results additionally carry the checker name and version.

Please cover:

  • Discover and run configured type tests through createRstest / listTests / run, including mixed runtime/type projects and typecheck.only.
  • Preserve source locations, nested names, and compiler diagnostics. Expression titles are their source text; files without static registrations have a single [typecheck] case.
  • Explain that name/file filters select reported cases while the full tsconfig remains checked. .only, .skip, parameterized and conditional registration modifiers are unsupported and produce collection errors.
  • Type tests run on the host for browser projects as well. They do not execute setup files, runtime hooks, snapshots, retries, or coverage; editor actions should respect those limits.
  • Type testing does not support watch mode. Use one-shot run actions for type cases; the core reports an error for watch plus typecheck.
  • Recognize @rstest/typecheck registration imports and preserve actionable missing-package/version-mismatch errors. Ordinary runtime projects do not require this package.
  • Verify onlyFailures across mixed runtime/type projects: core shares file failure history and falls back to a full run once no recorded failures remain. Explicit file/name filters take precedence.
  • Respect bail results: later type cases and projects are not reported after the run-wide limit; the compiler invocation already started for a project still checks the full tsconfig.
  • Include discovery/run/result mapping tests against the core PR build before release.

Core PR: https://github.com/web-infra-dev/rstest/pull/1984

Langage dominant
TypeScript
Étoiles
13
Forks
1
Merge moyen
2 j 52 min
PR mergées (30 j)
25

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de rstackjs/rstack-editor

Toutes les issues de rstackjs/rstack-editor

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.