Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Vitest config is dropped when test.server.deps.external already lists solid-js

未關閉 適合新手
#454 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@RaphaelFakhri 已經在處理了。

開始於 2026年10月19日。

  • #455 來自 @RaphaelFakhri —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
78/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
typescript, vite
領域
testing

研究方向

從 src/index.ts 開始,閱讀 ...(test.server ? { test } : {}) 周圍的設定合併邏輯;將其與 issue 中描述的 next 分支行為進行比較。檢查現有的 Vitest 設定測試,或新增一個使用 test.server.deps.external 的重現案例,其中已經列出 solid-js。當解析後的設定在兩種情況下都仍包含 environment: 'jsdom' 和 jest-dom 設定檔時,即為完成。

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

描述

On the 2.x line (main), vite-plugin-solid returns its test config only when it also sets test.server. If the user config already has solid-js in test.server.deps.external, the plugin does not set test.server, so it also drops test.environment = 'jsdom' and the @testing-library/jest-dom setup file.

Reproduction

// vitest.config.ts
import { defineConfig } from 'vitest/config';
import solid from 'vite-plugin-solid';

export default defineConfig({
  plugins: [solid()],
  test: { server: { deps: { external: [/solid-js/] } } },
});

The resolved Vitest config has no environment and no jest-dom setup file, so tests run in the default node environment, where DOM APIs such as document are not defined. Without the server.deps.external entry, the plugin sets both.

Expected behavior

The plugin sets the jsdom environment and the jest-dom setup file whether or not solid-js is already external. The next branch already does this (Object.keys(test).length ? { test } : {}).

Cause

Introduced in #183: ...(test.server ? { test } : {}) in src/index.ts.

主要語言
TypeScript
星號
522
分支
73
平均合併
1 天 8 小時
30 天內合併 PR
31

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

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

solidjs/solid-vite-plugin 的其他 Issue

查看 solidjs/solid-vite-plugin 的全部 Issue

相似的 Issue

更多 TypeScript Issue

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

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