fix: test tags options should overwrite inherited suite options + inherit suite options in task API#10216
Merged
sheremet-va merged 4 commits intovitest-dev:mainfrom Apr 28, 2026
Conversation
Co-authored-by: Codex <noreply@openai.com>
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
tags options should overwrite inherited suite options + inherit suite options in raw task APItags options should overwrite inherited suite options + inherit suite options in task API
sheremet-va
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
test.tagsoptions doesn't overwrite inherited suite options #10199I was reviewing #10203 and it looks like grabbing
collectorContext.currentSuite?.optionsseems like a right fix. Here is why:This fixes suite option merging during test collection. Tests now merge options in the intended priority order:
This ensures tag options can override inherited suite defaults while still allowing the test’s own options to win.
By using
collectorContext.currentSuite?.optionsinsidetaskfunction, this also makes the advanced raw task API consistent with normaltest()collection: tasks registered throughTestRunner.getCurrentSuite().task(...)now inherit options from the current suite. This matches the documented custom task collector behavior that should act like a test collector. Notably some properties are already inherited based on context such astask.meta.A regression test was added for custom task collectors using the raw task API to verify inherited
concurrent,repeats,retry, andtimeoutoptions.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.