From b339c9f2e5a5d085c66d3e54b3c26f3a3cdb94ec Mon Sep 17 00:00:00 2001 From: prklm10 Date: Tue, 26 Nov 2024 12:54:31 +0530 Subject: [PATCH] test fix --- test/storybook.test.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/test/storybook.test.js b/test/storybook.test.js index 4e43d76e..17b4986c 100644 --- a/test/storybook.test.js +++ b/test/storybook.test.js @@ -173,12 +173,15 @@ describe('percy storybook', () => { await expectAsync(storybook(['http://localhost:8000'])) // message contains the client stack trace - .toBeRejectedWithError(/^Story Error\n.*\/iframe\.html.*$/s); + .toBeRejectedWithError(/^\[percy\] Error: Snapshot Name:/s); expect(logger.stderr).toEqual([ '[percy] Build not created', // message contains the client stack trace - jasmine.stringMatching(/^\[percy\] Snapshot Name: .*\nError: Story Error\n.*\/iframe\.html.*$/s) + jasmine.stringMatching( + /^\[percy\] Error: Snapshot Name:/s + ) + ]); }); @@ -223,8 +226,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\] Snapshot Name: .*\nError: Story Error\n.*\/iframe\.html.*$/s), - + jasmine.stringMatching( + /^\[percy\] Error: Snapshot Name:/s + ), // does not create a build if all stories failed [ 1 in this case ] '[percy] Build not created' ]); @@ -270,11 +274,13 @@ describe('percy storybook', () => { // contains logs of story error expect(logger.stderr).toEqual([ - '[percy] Retrying Story: foo: bar', - '[percy] Retrying Story: foo: bar', + '[percy] Retrying Story: foo: bar, attempt: 1', + '[percy] Retrying Story: foo: bar, attempt: 2', '[percy] Failed to capture story: foo: bar', // error logs contain the client stack trace - jasmine.stringMatching(/^\[percy\] Snapshot Name: .*\nError: Story Error\n.*\/iframe\.html.*$/s), + jasmine.stringMatching( + /^\[percy\] Error: Snapshot Name:/s + ), // does not create a build if all stories failed [ 1 in this case ] '[percy] Build not created'