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 db59dfd commit 6942aa0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions test/storybook.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,11 @@ describe('percy storybook', () => {
expect(logger.stderr).toEqual([
'[percy] Build not created',
// message contains the client stack trace
jasmine.stringMatching(
/^Snapshot Name: .*\n\[percy\] Error: Story Error\n.*\/iframe\.html.*$/s
)
jasmine.stringMatching(/^\[percy\] Snapshot Name: .*\nError: Story Error\n.*\/iframe\.html.*$/s)
]);
});

fdescribe('with PERCY_SKIP_STORY_ON_ERROR set to true', () => {
describe('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 @@ -225,9 +223,8 @@ describe('percy storybook', () => {
expect(logger.stderr).toEqual([
'[percy] Failed to capture story: foo: bar',
// error logs contain the client stack trace
jasmine.stringMatching(
/^Snapshot Name: .*\n\[percy\] Error: Story Error\n.*\/iframe\.html.*$/s
),
jasmine.stringMatching(/^\[percy\] Snapshot Name: .*\nError: 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 @@ -277,9 +274,8 @@ describe('percy storybook', () => {
'[percy] Retrying Story: foo: bar',
'[percy] Failed to capture story: foo: bar',
// error logs contain the client stack trace
jasmine.stringMatching(
/^Snapshot Name: .*\n\[percy\] Error: Story Error\n.*\/iframe\.html.*$/s
),
jasmine.stringMatching(/^\[percy\] Snapshot Name: .*\nError: 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 6942aa0

Please sign in to comment.