Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta Para iniciantes
#454 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@RaphaelFakhri já está trabalhando nisso.

Desde 19/10/2026.

  • #455 de @RaphaelFakhri — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
78/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
typescript, vite
Domínio
testing

Direção de pesquisa

Comece em src/index.ts e leia a mesclagem da configuração em torno de ...(test.server ? { test } : {}); compare-a com o comportamento do branch next descrito na issue. Verifique os testes existentes da configuração do Vitest ou adicione uma reprodução usando test.server.deps.external, com solid-js já listado. O trabalho estará concluído quando a configuração resolvida ainda incluir environment: 'jsdom' e o arquivo de configuração do jest-dom em ambos os casos.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
522
Forks
73
Merge médio
1d 8h
PRs com merge (30d)
31

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de solidjs/solid-vite-plugin

Todas as issues de solidjs/solid-vite-plugin

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.