Skip to content

fix!: don't lookup config file from ancestor directories#10428

Merged
sheremet-va merged 10 commits into
vitest-dev:mainfrom
hi-ogawa:fix/local-config-discovery
Jun 2, 2026
Merged

fix!: don't lookup config file from ancestor directories#10428
sheremet-va merged 10 commits into
vitest-dev:mainfrom
hi-ogawa:fix/local-config-discovery

Conversation

@hi-ogawa

@hi-ogawa hi-ogawa commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR changes config discovery behavior to limit just root to avoid accidentally config file from parent directories being picked up. This behavior also aligns with how Vite discovers config.

TODO

  • test
  • docs
  • remove empty config from fixtures (follow-up)

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Co-authored-by: Codex <noreply@openai.com>
@netlify

netlify Bot commented May 22, 2026

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b18adbd
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6a1e846ae9cc8100089719f1
😎 Deploy Preview https://deploy-preview-10428--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@hi-ogawa hi-ogawa moved this to Approved in Team Board May 29, 2026
@hi-ogawa hi-ogawa self-assigned this May 29, 2026
hi-ogawa and others added 7 commits June 2, 2026 10:01
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@hi-ogawa hi-ogawa marked this pull request as ready for review June 2, 2026 02:59
import type { VitestRunMode } from './types/config'
import { resolve } from 'node:path'
import { deepClone, slash } from '@vitest/utils/helpers'
import * as find from 'empathic/find'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one more usage in vitest init where we could remove it. Then empathic won't be used and we can remove the dependency too

@sheremet-va sheremet-va merged commit 945d909 into vitest-dev:main Jun 2, 2026
17 of 18 checks passed
@hi-ogawa hi-ogawa deleted the fix/local-config-discovery branch June 2, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

vitest should fail for nonexistent root directory

2 participants