From 96a092729136105bd3c65f7b3333624c0452843f Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Thu, 21 Sep 2023 15:59:27 +0800 Subject: [PATCH] chore: update jest timeout --- jest.config.js | 2 +- .../unicloud-database.test.js | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/jest.config.js b/jest.config.js index f3dd67c9..0e0eb163 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,5 @@ module.exports = { - testTimeout: 10000, + testTimeout: 30000, reporters: ['default'], watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'], moduleFileExtensions: ['js', 'json'], diff --git a/pages/API/unicloud-database/unicloud-database.test.js b/pages/API/unicloud-database/unicloud-database.test.js index f0be3dfd..a691f6c1 100644 --- a/pages/API/unicloud-database/unicloud-database.test.js +++ b/pages/API/unicloud-database/unicloud-database.test.js @@ -10,17 +10,17 @@ describe('unicloud-database', () => { await page.callMethod('dbRemove') await page.waitFor(3000) await page.callMethod('dbAdd') - await page.waitFor(2000) + await page.waitFor(1500) await page.callMethod('dbBatchAdd') - await page.waitFor(2000) + await page.waitFor(1500) await page.callMethod('dbGet') - await page.waitFor(2000) + await page.waitFor(1500) await page.callMethod('dbGetWithCommand') - await page.waitFor(2000) + await page.waitFor(1500) await page.callMethod('dbUpdate') - await page.waitFor(2000) + await page.waitFor(1500) await page.callMethod('dbRemove') - await page.waitFor(2000) + await page.waitFor(1500) const { addId, @@ -32,13 +32,11 @@ describe('unicloud-database', () => { removeDeleted, } = await page.data() - console.error((await page.data()).batchAddinserted) - - expect(addId.length > 0).toBe(true) + expect(addId !== '').toBe(true) expect(batchAddIds.length).toBe(2) expect(batchAddinserted).toBe(2) expect(getData.length).toBe(2) - expect(getWithCommandData.length).toBe(2) + expect(getWithCommandData.length).toBe(1) expect(updateUpdated).toBe(3) expect(removeDeleted).toBe(3) @@ -48,7 +46,7 @@ describe('unicloud-database', () => { await page.callMethod('dbLookupInit') await page.waitFor(3000) await page.callMethod('dbLookup') - await page.waitFor(2000) + await page.waitFor(1500) const { lookupData -- GitLab