Check for `@testing-library/jest-dom` doesn't guarantee it's safe to use as `setupFiles` in Vitest
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- testing
調査の方向性
Start with src/index.ts around lines 182-191, then run the pnpm minimal reproduction with Vitest described in the issue. Compare behavior with and without the transitive storybook dependency, and verify that the empty Solid/Vitest project still runs when the package is not a direct dependency.
索引モデルが issue の本文から書いたものです。
説明
This check doesn't guarantee that passing '@testing-library/jest-dom/vitest' as setupFiles to Vitest is safe.
The current check:
only verifies that eslint-plugin-solid itself can resolve @testing-library/jest-dom/vitest.
It does not guarantee that Vitest can safely use it as a setupFiles entry.
Problem
In my project (using pnpm), I hit a false positive:
storybookdepends directly on@testing-library/jest-dom.storybook-solidjs-vitedepends onvite-plugin-solidvite-plugin-solidlists@testing-library/jest-domas an optional peer dependency.- Because of
pnpm’s virtual store, both end up colocated such thatrequire.resolve("@testing-library/jest-dom/vitest")fromvite-plugin-solidsucceeds.
However, my project itself doesn’t depend on @testing-library/jest-dom, since I only use Vitest with vite-plugin-solid for reactivity tests (no DOM tests).
When Vitest parses the config, it can resolve vite-plugin-solid, but it cannot resolve the automatically added @testing-library/jest-dom/vitest import. This breaks the setup.
Minimal Reproduction
- Create an empty project
pnpm init
pnpm add -D vitest vite vite-plugin-solid
- Add a vitest.config.js with
export default defineConfig({
plugins: [solid()],
test: {
environment: "node",
},
});
And a simple test file (it should run).
- Reinstall dependencies, this time with a transitive dependency on @testing-library/jest-dom:
pnpm add -D storybook storybook-solidjs-vite
- Run the test, it should now fail with "Failed to load url .../@testing-library/jest-dom/vitest".
- 主要言語
- TypeScript
- スター
- 522
- フォーク
- 72
- 平均マージ
- 21時間 42分
- マージ済み PR(30日)
- 35
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid-vite-plugin のほかの issue
-
Test environment detection doesn't consider Vitest workspaces対応中かも @carloitaben が 42 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
solidjs/solid-vite-plugin#205 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
solidjs/solid-vite-plugin#391 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
solidjs/solid-vite-plugin#390 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
solidjs/solid-vite-plugin#388 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
solidjs/solid-vite-plugin#387 ·
メンテナーはふだん 1 日以内に返信
solidjs/solid-vite-plugin の issue をすべて見る
似ている issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
LucasSantana-Dev/Lucky#2637 ·
メンテナーはふだん 1 日以内に返信
-
Show the error reference on the error page対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
tomjn/coilbox-hub#454 ·
メンテナーはふだん 1 日以内に返信
-
frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
icssc/peterportal-client#1224 · コメント 1 件 ·
-
testplan-item
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信