Skip to content

Commit

Permalink
testing cf is painfully slower, relase 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
good-lly committed Aug 26, 2024
1 parent e08c60d commit 1ef206b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion general.jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"collectCoverage": false,
"testMatch": ["**/src/*.test.js"],
"testEnvironment": "node",
"testTimeout": 70000,
"testTimeout": 90000,
"silent": false
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
13 changes: 6 additions & 7 deletions src/lowstorage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand All @@ -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);

Expand Down

0 comments on commit 1ef206b

Please sign in to comment.