-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
TestAddon: Exclude *.stories.*
from coverage
#29810
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ export class VitestManager { | |
clean: false, | ||
cleanOnRerun: !watchMode, | ||
reportOnFailure: true, | ||
exclude: [...(this.vitest?.config?.coverage?.exclude || []), '**/*.stories.*'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So I don't think this is adequate to combine with the user's and/or Vitest's default We need to first resolve the Vitest config, and then we can read from it. The Vitest maintainers have given me a code snippet like this, that should work (maybe with slight modifications): import { resolveConfig as viteResolveConfig } from 'vite';
import { VitestPlugin, resolveConfig as vitestResolveConfig } from 'vitest/node';
const resolveConfig = async () => {
const viteConfig = await viteResolveConfig({
plugins: [VitestPlugin()]
});
return vitestResolveConfig(viteConfig);
} |
||
reporter: [['html', {}], storybookCoverageReporter], | ||
reportsDirectory: resolvePathInStorybookCache(COVERAGE_DIRECTORY), | ||
} | ||
|
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.