Check for `@testing-library/jest-dom` doesn't guarantee it's safe to use as `setupFiles` in Vitest
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- testing
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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".
- Ngôn ngữ chính
- TypeScript
- Star
- 522
- Fork
- 72
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 31
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs/solid-vite-plugin
-
Test environment detection doesn't consider Vitest workspacesCó thể đã có người làm @carloitaben đã nhận 43 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
solidjs/solid-vite-plugin#205 · 1 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 65/100
solidjs/solid-vite-plugin#394 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Catch-all route chunks are named `_...404_-<hash>.js`; the `..` trips path-traversal guards and breaks the lazy preloadCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
solidjs/solid-vite-plugin#391 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
solidjs/solid-vite-plugin#390 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Start mode: generated entries render without the CSP nonce, and there is no per-request seam to supply oneCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
solidjs/solid-vite-plugin#388 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid-vite-plugin
Issue tương tự
-
Upgrade node-libzim to 4.7.0Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
openzim/mwoffliner#2933 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Use the README category name for website links and submissionsCó thể đã có người làm @dajiaohuang đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
birobirobiro/awesome-shadcn-ui#647 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Add: Valea Prahovei TV RO SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Urigo/accounter-fullstack#4604 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày