Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prklm10 committed Nov 26, 2024
1 parent 2e6fa2a commit db59dfd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/storybook.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,13 @@ describe('percy storybook', () => {
expect(logger.stderr).toEqual([
'[percy] Build not created',
// message contains the client stack trace
jasmine.stringMatching(/^\[percy\] Error: Story Error\n.*\/iframe\.html.*$/s)
jasmine.stringMatching(
/^Snapshot Name: .*\n\[percy\] Error: Story Error\n.*\/iframe\.html.*$/s
)
]);
});

describe('with PERCY_SKIP_STORY_ON_ERROR set to true', () => {
fdescribe('with PERCY_SKIP_STORY_ON_ERROR set to true', () => {
beforeAll(() => {
process.env.PERCY_SKIP_STORY_ON_ERROR = true;
process.env.PERCY_RETRY_STORY_ON_ERROR = false;
Expand Down Expand Up @@ -223,7 +225,9 @@ describe('percy storybook', () => {
expect(logger.stderr).toEqual([
'[percy] Failed to capture story: foo: bar',
// error logs contain the client stack trace
jasmine.stringMatching(/^\[percy\] Error: Story Error\n.*\/iframe\.html.*$/s),
jasmine.stringMatching(
/^Snapshot Name: .*\n\[percy\] Error: Story Error\n.*\/iframe\.html.*$/s
),
// does not create a build if all stories failed [ 1 in this case ]
'[percy] Build not created'
]);
Expand Down Expand Up @@ -273,7 +277,9 @@ describe('percy storybook', () => {
'[percy] Retrying Story: foo: bar',
'[percy] Failed to capture story: foo: bar',
// error logs contain the client stack trace
jasmine.stringMatching(/^\[percy\] Error: Story Error\n.*\/iframe\.html.*$/s),
jasmine.stringMatching(
/^Snapshot Name: .*\n\[percy\] Error: Story Error\n.*\/iframe\.html.*$/s
),
// does not create a build if all stories failed [ 1 in this case ]
'[percy] Build not created'
]);
Expand Down

0 comments on commit db59dfd

Please sign in to comment.