react-screenshot-test: Async Callback Timeout Error
Hey π library looks great. I am just trying to get a simple example spun up and having issues.
I get the following error:
> jest -c jest.screenshot.config.js
FAIL components/Button/__tests__/ button.screenshot.tsx (20.439s)
Button
Desktop
β with label (5005ms)
β no label (5002ms)
iPhone X
β with label (5002ms)
β no label (5006ms)
β Button βΊ Desktop βΊ with label
: Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:
at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
at Suite.<anonymous> (node_modules/react-screenshot-test/dist/lib/react/ReactScreenshotTest.js:124:25)
β Button βΊ Desktop βΊ no label
: Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:
at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
at Suite.<anonymous> (node_modules/react-screenshot-test/dist/lib/react/ReactScreenshotTest.js:124:25)
β Button βΊ iPhone X βΊ with label
: Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:
at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
at Suite.<anonymous> (node_modules/react-screenshot-test/dist/lib/react/ReactScreenshotTest.js:124:25)
β Button βΊ iPhone X βΊ no label
: Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:
at new Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:116:22)
at Suite.<anonymous> (node_modules/react-screenshot-test/dist/lib/react/ReactScreenshotTest.js:124:25)
Test looks like:
import React from 'react';
import { ReactScreenshotTest } from 'react-screenshot-test';
ReactScreenshotTest.create('Button')
.viewport('Desktop', {
width: 1024,
height: 768,
})
.viewport('iPhone X', {
width: 375,
height: 812,
deviceScaleFactor: 3,
isMobile: true,
hasTouch: true,
isLandscape: false,
})
.shoot('with label', <div>Hello</div>)
.shoot('no label', <div>No</div>)
.run();
and I am using the config you give in the documentation.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 22 (9 by maintainers)
Commits related to this issue
- Add plenty of debug logging, enabled with SCREENSHOT_LOGGING_LEVEL=debug This should help debug #178. — committed to fwouts/react-screenshot-test by fwouts 4 years ago
- Add debug logging for Docker container This should help debug #178. — committed to fwouts/react-screenshot-test by fwouts 4 years ago
@fwouts π That worked a treat. Thanks for the update.
Hey @fwouts, so I can confirm that option 1 works π
To test I moved the sample test file to a new directory named
screens
and then just added:to the
jest.screenshot.config.js
Sounds like this is a workable solution for now. Thanks for all the support on it.
Hey @fwouts, apologies in the delay on getting back. Things got a little crazy there for a while.
Just re-testing this now and still getting the error.
I am using
styled-components
. I tried running it with Styled Components5.0.1
and again with5.1.0
with no joy.And just to confirm. My config is:
Itβs strange that in my existing project it will not run, how ever in the hello world one I created it does.
Hey guys, I had the SAME problem on my side In my case I had some things happening in my
setupFilesAfterEnv
although it works with my regular jest testsAfter removing it from my
jest.screenshot.config.js
the timeout stop to happen. So I tried to create a separate file forsetupFilesAfterEnv
cleaning the functions and logic not used by the screenshot testing, and so it back to work.