Skip to content

Commit

Permalink
Update preview error
Browse files Browse the repository at this point in the history
  • Loading branch information
ethriel3695 committed Apr 16, 2024
1 parent 2631ef7 commit ffd17e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.

This file was deleted.

9 changes: 4 additions & 5 deletions code/lib/core-events/src/errors/preview-errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ import { describe, it, expect } from 'vitest';
import { UnknownArgTypesError } from './preview-errors';

describe('UnknownFlowArgTypesError', () => {
it('should correctly handle error with Flow convertSig', () => {
it('should correctly handle error with convertSig', () => {
const type = {
name: 'signature',
raw: "SomeType['someProperty']",
};

const message = `There was a failure when generating ArgTypes
in Typescript for {"name":"signature","raw":"SomeType['someProperty']"}
const message = `"There was a failure when generating ArgTypes in Typescript for {"name":"signature","raw":"SomeType['someProperty']"}
This type is either not supported or it is a bug in Storybook.
If you think this is a bug, please open an issue in Github.`;
If you think this is a bug, please open an issue in Github."`;

const typeError = new UnknownArgTypesError({ type, language: 'Typescript' });
expect(typeError.message).toMatchSnapshot(message);
expect(typeError.message).toMatchInlineSnapshot(message);
});
});
4 changes: 2 additions & 2 deletions code/lib/core-events/src/errors/preview-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ export class UnknownArgTypesError extends StorybookError {
}

template() {
return dedent`There was a failure when generating ArgTypes in ${
return `There was a failure when generating ArgTypes in ${
this.data.language
} for ${JSON.stringify(this.data.type)}.
} for ${JSON.stringify(this.data.type)}
This type is either not supported or it is a bug in Storybook.
If you think this is a bug, please open an issue in Github.`;
}
Expand Down

0 comments on commit ffd17e8

Please sign in to comment.