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: export default config to expand it #702

Merged
merged 7 commits into from Feb 9, 2022
Merged

Conversation

sheremet-va
Copy link
Member

Fixes #701

@netlify
Copy link

netlify bot commented Feb 8, 2022

✔️ 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

docs/config/index.md Outdated Show resolved Hide resolved
@@ -1,11 +1,37 @@
import { fileURLToPath } from 'url'
import { resolve } from 'pathe'
import type { UserConfig } from './types'
import { defaults as coverageDefaults } from './integrations/coverage'
Copy link
Member

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.

Copy link
Member Author

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.

uiBase: '/__vitest__/',
open: true,
coverage: coverageDefaults,
}
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Froze both objects

You can retrieve Vitest's default options to expand them if needed:

```ts
import { defineConfig, defaultConfig } from 'vitest'
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 👁️ 👁️

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.

None yet

4 participants