Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow inline workspace configuration #6923

Merged
merged 8 commits into from
Nov 19, 2024

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Nov 18, 2024

Description

Fixes #6913

This PR allows specifying an array in test.workspaces option. This will override the vitest.workspace file if there is one:

import { defineConfig } from 'vitest'
export default defineConfig({
  test: {
    workspace: [
      './packages/*',
      {
        test: {
          name: 'inline',
        },
      },
    ],
  },
})

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.

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:.

Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 851b02f
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/673b67825b94f400081975fa
😎 Deploy Preview https://deploy-preview-6923--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@sheremet-va sheremet-va force-pushed the feat/inline-workspace branch from 355dcb4 to 851b02f Compare November 18, 2024 16:12
hi-ogawa
hi-ogawa previously approved these changes Nov 19, 2024
AriPerkkio
AriPerkkio previously approved these changes Nov 19, 2024
Copy link
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

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

Looks good, this will be really handy!

In some comments the extends: true says it makes project inherit all options from root even when it inherits only the ones that can be used in project level settings. Maybe that could be made more specific. 🤔

@sheremet-va
Copy link
Member Author

sheremet-va commented Nov 19, 2024

Looks good, this will be really handy!

In some comments the extends: true says it makes project inherit all options from root even when it inherits only the ones that can be used in project level settings. Maybe that could be made more specific. 🤔

I don't understand what you mean. extends will merge the project config with root config, inheriting all properties. If some of them are root-only, then it doesn't really matter because they are not applied to project configs 🤔 Users can't override them because they are root-only. And if they don't override them, then they are already implicitly applied

@AriPerkkio
Copy link
Member

AriPerkkio commented Nov 19, 2024

If some of them are root-only, then it doesn't really matter because they are not applied to project configs

Oh that's right! I was thinking this the other way around.

And now that workspace is enforcing the types of defineProject() I hope there will be less confusion about project-only settings.

@sheremet-va sheremet-va dismissed stale reviews from AriPerkkio and hi-ogawa via d8aa6e5 November 19, 2024 12:27
@sheremet-va sheremet-va merged commit 562e1b1 into vitest-dev:main Nov 19, 2024
6 checks passed
@sheremet-va sheremet-va deleted the feat/inline-workspace branch November 19, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow inline workspace
3 participants