Support Rstest static type tests in discovery and run actions

未關閉
#111 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
38/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
typescript
領域
devtools, testing

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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

主要語言
TypeScript
星號
13
分支
1
平均合併
2 天 52 分鐘
30 天內合併 PR
25

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

rstackjs/rstack-editor 的其他 Issue

查看 rstackjs/rstack-editor 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。