Skip to content

Commit

Permalink
document errorMessageFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jun 22, 2024
1 parent d12895b commit 897ddba
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,23 @@ const config: TestRunnerConfig = {
export default config;
```

#### errorMessageFormatter

The `errorMessageFormatter` property defines a function that will pre-format the error messages before they get reported in the CLI:

```ts
// .storybook/test-runner.ts
import type { TestRunnerConfig } from '@storybook/test-runner';

const config: TestRunnerConfig = {
errorMessageFormatter: (message) => {
// manipulate the error message as you like
return message;
},
};
export default config;
```

### Utility functions

For more specific use cases, the test runner provides utility functions that could be useful to you.
Expand Down

0 comments on commit 897ddba

Please sign in to comment.