From 1ef206b5f109dec8504b8f7b084abad9b7d04ab2 Mon Sep 17 00:00:00 2001 From: Jolly Good <1671375+good-lly@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:04:51 +0200 Subject: [PATCH] testing cf is painfully slower, relase 2.0.0 --- general.jest.config.json | 2 +- package.json | 2 +- src/lowstorage.test.js | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/general.jest.config.json b/general.jest.config.json index d328c5c..9942ecf 100644 --- a/general.jest.config.json +++ b/general.jest.config.json @@ -4,6 +4,6 @@ "collectCoverage": false, "testMatch": ["**/src/*.test.js"], "testEnvironment": "node", - "testTimeout": 70000, + "testTimeout": 90000, "silent": false } diff --git a/package.json b/package.json index c18bede..4f2a89c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "prettier:fix": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", "build": "tsc && esbuild --bundle --platform=node --target=node20 --format=esm ./src/lowstorage.js | node importify-esbuild-output.js | esbuild --bundle --minify --sourcemap --platform=node --target=node20 --format=esm --outfile=build/lowstorage.min.js", "test:all": "npm run test:cf && npm run test:minio", - "test:cf": "node --env-file ./.env --experimental-vm-modules node_modules/jest/bin/jest.js --config=general.jest.config.json --no-cache", + "test:cf": "node --env-file ./.env --experimental-vm-modules node_modules/jest/bin/jest.js --config=general.jest.config.json --detectOpenHandles", "test:minio": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config=minio.jest.config.json --no-cache", "clear": "rm -rf build && rm -rf lib" }, diff --git a/src/lowstorage.test.js b/src/lowstorage.test.js index ecd3a79..8944a53 100644 --- a/src/lowstorage.test.js +++ b/src/lowstorage.test.js @@ -140,9 +140,9 @@ test('Collections | create via createCollection', async () => { const removeCollection = await lStorage.removeCollection('userCol'); expect(removeCollection).toBe(true); - const listCollections2 = await lStorage.listCollections(); - expect(listCollections2).not.toContain('userCol'); - expect(listCollections2.length).toBe(0); + const listCollections22 = await lStorage.listCollections(); + expect(listCollections22).not.toContain('userCol'); + expect(listCollections22.length).toBe(0); }); test('Collections | create via constructor', async () => { const preListCheck = await lStorage.listCollections(); @@ -160,9 +160,9 @@ test('Collections | create via constructor', async () => { const removeCollection = await lStorage.removeCollection('userCol'); expect(removeCollection).toBe(true); - const listCollections2 = await lStorage.listCollections(); - expect(listCollections2).not.toContain('userCol'); - expect(listCollections2.length).toBe(0); + const listCollections3 = await lStorage.listCollections(); + expect(listCollections3).not.toContain('userCol'); + expect(listCollections3.length).toBe(0); }); test('Collections | error cases and error codes', async () => { // Test create collection error @@ -186,7 +186,6 @@ test('Collections | error cases and error codes', async () => { await expect(tesCol2).toBeDefined(); await expect(tesCol2).toBeInstanceOf(Object); - const listCollections2 = await lStorage.listCollections(); const tesCol2Exists = await lStorage.collectionExists('testCol2'); expect(tesCol2Exists).toBe(true);