Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Test environment detection doesn't consider Vitest workspaces

オープン 初心者向け
#205 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript, vite
領域
testing-qa

調査の方向性

src/index.ts の 213-224 行目から始め、リンクされた再現例の test.workspace 設定と、plugin によるテスト環境の検出を比較してください。workspace ベースの環境が尊重され、vite.config.ts の workaround が不要になっていることを確認し、jsdom のインストールを繰り返し要求されないことも確認してください。

索引モデルが issue の本文から書いたものです。

説明

Hello! I am integrating the new Vitest Browser mode into a project using Solid. Their guide suggests that if you want to use it alongside other test environments, you should configure it using workspaces.

The Solid Vite plugin does not appear to read the user test.workspace configuration and defaults to jsdom.

// ...
      const userTest = (userConfig as any).test ?? {};
      const test = {} as any;
      if (userConfig.mode === 'test') {
        // ...
        if (!userTest.environment && !options.ssr) {
          test.environment = 'jsdom';
        }
// ...

Which results on being prompted to install jsdom each time

Image

Reproduction

I made a quick reproduction here.

Workaround

My current workaround is to do this on my vite.config.ts:

import { defineConfig } from "vite"
import solid from "vite-plugin-solid"
import tsConfigPaths from "vite-tsconfig-paths"

export default defineConfig({
  plugins: [tsConfigPaths(), solid()],
  test: {
    // Workaround for Solid Vite plugin. Get's superseeded by `workspace` config
    environment: "node",
    workspace: [
      {
        extends: true,
        test: {
          include: ["**/*.test.{ts,tsx}"],
          name: "Node.js",
          environment: "node",
        },
      },
      {
        extends: true,
        test: {
          include: ["**/*.test.dom.{ts,tsx}"],
          browser: {
            enabled: true,
            headless: true,
            ui: false,
            provider: "playwright",
            instances: [
              {
                browser: "chromium",
                name: "DOM",
              },
            ],
          },
        },
      },
    ],
  },
})

Could the Solid Vite plugin also check the user test.workspace configuration? 🙂 I can draft a PR if the request makes sense

主要言語
TypeScript
スター
522
フォーク
72
平均マージ
21時間 42分
マージ済み PR(30日)
35

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

solidjs/solid-vite-plugin のほかの issue

solidjs/solid-vite-plugin の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。