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

Introduce logLevel configuration #406

Merged
merged 1 commit into from Nov 27, 2023
Merged

Introduce logLevel configuration #406

merged 1 commit into from Nov 27, 2023

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Nov 27, 2023

This PR adds a feature to tweak with logLevels in the test-runner.

As part of this work, the following methods are also collected (in verbose log level): info, table, dir, debug

logLevel

When tests fail and there were browser logs during the rendering of a story, the test-runner provides the logs alongside the error message. The logLevel property defines what kind of logs should be displayed:

  • info (default): Shows console logs, warnings, and errors.
  • warn: Shows only warnings and errors.
  • error: Displays only error messages.
  • verbose: Includes all console outputs, including debug information and stack traces.
  • none: Suppresses all log output.
// .storybook/test-runner.ts
import type { TestRunnerConfig } from '@storybook/test-runner';

const config: TestRunnerConfig = {
  logLevel: 'verbose',
};
export default config;
πŸ“¦ Published PR as canary version: 0.16.0--canary.406.dd7eb64.0

✨ Test out this PR locally via:

npm install @storybook/test-runner@0.16.0--canary.406.dd7eb64.0
# or 
yarn add @storybook/test-runner@0.16.0--canary.406.dd7eb64.0

Version

Published prerelease version: v0.16.0-next.0

Changelog

πŸš€ Enhancement

πŸ› Bug Fix

Authors: 4

@yannbf yannbf added feature request New feature or request minor Increment the minor version when merged labels Nov 27, 2023
Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests βœ…

Comparison is base (ad3d401) 93.72% compared to head (dd7eb64) 93.72%.

Additional details and impacted files
@@           Coverage Diff           @@
##             next     #406   +/-   ##
=======================================
  Coverage   93.72%   93.72%           
=======================================
  Files          15       15           
  Lines         271      271           
  Branches       70       70           
=======================================
  Hits          254      254           
  Misses         17       17           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

Copy link
Member

@IanVS IanVS left a comment

Choose a reason for hiding this comment

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

Great feature!

@yannbf yannbf merged commit 99b800b into next Nov 27, 2023
17 checks passed
@yannbf yannbf mentioned this pull request Nov 27, 2023
Copy link

πŸš€ PR was released in v0.16.0 πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request minor Increment the minor version when merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants