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: export default config to expand it #702
Conversation
✔️ Deploy Preview for vitest-dev ready! 🔨 Explore the source changes: 39430cc 🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/6203bfc69b34ec00071405f0 😎 Browse the preview: https://deploy-preview-702--vitest-dev.netlify.app |
packages/vitest/src/constants.ts
Outdated
@@ -1,11 +1,37 @@ | |||
import { fileURLToPath } from 'url' | |||
import { resolve } from 'pathe' | |||
import type { UserConfig } from './types' | |||
import { defaults as coverageDefaults } from './integrations/coverage' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move the default from coverage to this file, the module is running in different context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved it there, but I still import it from here.
packages/vitest/src/constants.ts
Outdated
uiBase: '/__vitest__/', | ||
open: true, | ||
coverage: coverageDefaults, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might also want to froze this object to avoid mutation on user land
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Froze both objects
docs/config/index.md
Outdated
You can retrieve Vitest's default options to expand them if needed: | ||
|
||
```ts | ||
import { defineConfig, defaultConfig } from 'vitest' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They look a bit similar 😅, how about configDefaults
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👁️ 👁️
Fixes #701