From 0076956e79816a58f0098a8e137e94d430bf8b3b Mon Sep 17 00:00:00 2001 From: nilshah98 Date: Wed, 25 Oct 2023 21:38:44 +0530 Subject: [PATCH] test: fix case where storybook had not loaded yet for live url testing --- test/storybook.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/storybook.test.js b/test/storybook.test.js index 2dd5adba..d652ddef 100644 --- a/test/storybook.test.js +++ b/test/storybook.test.js @@ -55,7 +55,11 @@ describe('percy storybook', () => { it('snapshots live urls', async () => { await storybook(['http://localhost:9000']); - expect(logger.stderr).toEqual([]); + // if there are stderr logs ensure it is only an acceptable warning + expect(logger.stderr).toEqual(logger.stderr.length ? [ + '[percy] Waiting on a response from Storybook...' + ] : []); + expect(logger.stdout).toEqual(jasmine.arrayContaining([ '[percy] Percy has started!', '[percy] Snapshot taken: Snapshot: First',