Skip to content

Commit

Permalink
add story to test console error failures
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Aug 4, 2023
1 parent c9d7f05 commit 542f0b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"build-storybook": "storybook build",
"release": "yarn build && auto shipit",
"test-storybook": "node dist/test-storybook",
"test-storybook:failures": "SKIP_SNAPSHOTS=true TEST_FAILURES=1 yarn test-storybook --json --outputFile test-results.json",
"test-storybook:failures": "SKIP_SNAPSHOTS=true TEST_FAILURES=1 yarn test-storybook --json --failOnConsole --outputFile test-results.json",
"test-storybook:no-cache": "yarn test-storybook --no-cache",
"test-storybook:json": "yarn test-storybook --stories-json",
"test-storybook:ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"yarn build-storybook --quiet && npx serve storybook-static -l 6006\" \"wait-on tcp:6006 && yarn test-storybook\"",
Expand Down
5 changes: 5 additions & 0 deletions stories/expected-failures/Failure.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export default {

const Template = (args) => <Page {...args} />;

export const ComponentLogsErrors = () => {
console.error('Console error with a failure');
return <div>Hello world</div>;
};

export const ComponentThrowsErrors = () => {
throw new Error('Component has a failure');
};
Expand Down

0 comments on commit 542f0b2

Please sign in to comment.