OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Message "Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout"

  • Thread starter Thread starter Asool
  • Start date Start date
A

Asool

Guest
I'm using Puppeteer and Jest to run some front end tests.

My tests look as follows:

Code:
describe("Profile Tab Exists and Clickable: /settings/user", () => {
    test(`Assert that you can click the profile tab`, async () => {
      await page.waitForSelector(PROFILE.TAB);
      await page.click(PROFILE.TAB);
    }, 30000);
});

Sometimes, when I run the tests, everything works as expectedly. Other times, I get an error:

Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.

Code:
     at node_modules/jest-jasmine2/build/queue_runner.js:68:21 <br/>
     at Timeout.callback [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:633:19)

This is strange because:


  1. I specified the timeout to be 30000


  2. Whether or not I get this error is seemingly very random

Why is this happening?

<p>I'm using Puppeteer and Jest to run some front end tests.</p>
<p>My tests look as follows:</p>
<pre class="lang-js prettyprint-override"><code>describe("Profile Tab Exists and Clickable: /settings/user", () => {
test(`Assert that you can click the profile tab`, async () => {
await page.waitForSelector(PROFILE.TAB);
await page.click(PROFILE.TAB);
}, 30000);
});
</code></pre>

<p>Sometimes, when I run the tests, everything works as expectedly. Other times, I get an error:</p>
<blockquote>
<p>Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.</p>
<pre><code> at node_modules/jest-jasmine2/build/queue_runner.js:68:21 <br/>
at Timeout.callback [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:633:19)
</code></pre>
</blockquote>
<p>This is strange because:</p>
<ol>
<li><p>I specified the timeout to be 30000</p>
</li>
<li><p>Whether or not I get this error is seemingly very random</p>
</li>
</ol>
<p>Why is this happening?</p>
 

Latest posts

A
Replies
0
Views
1
Alfredo Augusto Petri
A
Top