1

I'm trying to stress test a dynamodb query using jest. I'm trying to get a pretty large json file (1.3 MB), but I keep getting the following error: "Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout"

I've using "jest.setTimeout(600000)" in the beforeEach but it still times out. I've also using the Timeout within the test with the same issue. I have also tried using done without any success.

  test('hugeDataTest', async(done) => {
    let hugeArray = await OutdoorDataLayer.getHistoricalOutdoorReports({
      Id: 'testId',
    });
    expect(hugeArray).toBeArrayOfSize(2000);
    done();
  });

I would like to make sure a large amount of data will pass successfully. Am I doing anything wrong with 'done()'?

skyboyer
  • 22,209
  • 7
  • 57
  • 64
Nathan
  • 77
  • 1
  • 9
  • 1
    `Am I doing anything wrong with 'done()'?` - You should use either `async` or `done` but not both like in the code above...but other than that the approach you are taking sounds correct. – Brian Adams Apr 26 '19 at 01:07

0 Answers0