From 8f17fb7f71f7a9702f1f96292b7a5cd0bd2866fa Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 20 Dec 2021 17:24:45 +0100 Subject: [PATCH] Tools: Fixed tests --- package.json | 4 ++-- packages/lib/package.json | 2 +- packages/lib/testing/test-utils.ts | 6 ++++++ yarn.lock | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a4876cabe..1a0560e00 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "tagServerLatest": "node packages/tools/tagServerLatest.js", "buildServerDocker": "node packages/tools/buildServerDocker.js", "setupNewRelease": "node ./packages/tools/setupNewRelease", - "test-ci": "yarn workspaces foreach --parallel --verbose --interlaced run test-ci", - "test": "yarn workspaces foreach --parallel --verbose --interlaced run test", + "test-ci": "yarn workspaces foreach --parallel --verbose --interlaced --jobs 3 run test-ci", + "test": "yarn workspaces foreach --parallel --verbose --interlaced --jobs 3 run test", "tsc": "yarn workspaces foreach --parallel --verbose --interlaced run tsc", "updateIgnored": "gulp updateIgnoredTypeScriptBuild", "updatePluginTypes": "./packages/generator-joplin/updateTypes.sh", diff --git a/packages/lib/package.json b/packages/lib/package.json index 1a374cae2..62bdd75f3 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -23,7 +23,7 @@ "@types/node-rsa": "^1.1.1", "@types/react": "^17.0.20", "clean-html": "^1.5.0", - "jest": "^26.6.3", + "jest": "26.6.3", "sharp": "^0.26.2", "typescript": "^4.0.5" }, diff --git a/packages/lib/testing/test-utils.ts b/packages/lib/testing/test-utils.ts index a17d42f21..313429fd6 100644 --- a/packages/lib/testing/test-utils.ts +++ b/packages/lib/testing/test-utils.ts @@ -428,6 +428,12 @@ async function setupDatabaseAndSynchronizer(id: number, options: any = null) { syncTarget.setFileApi(fileApi()); syncTarget.setLogger(logger); synchronizers_[id] = await syncTarget.synchronizer(); + + // For now unset the share service as it's not properly initialised. + // Share service tests are in ShareService.test.ts normally, and if it + // becomes necessary to test integration with the synchroniser we can + // initialize it here. + synchronizers_[id].setShareService(null); } encryptionServices_[id] = new EncryptionService(); diff --git a/yarn.lock b/yarn.lock index 2195a1403..01998252e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3134,7 +3134,7 @@ __metadata: image-data-uri: ^2.0.0 image-type: ^3.0.0 immer: ^7.0.14 - jest: ^26.6.3 + jest: 26.6.3 js-yaml: ^4.1.0 levenshtein: ^1.0.5 lodash: ^4.17.20 @@ -17981,7 +17981,7 @@ __metadata: languageName: node linkType: hard -"jest@npm:^26.6.3": +"jest@npm:26.6.3, jest@npm:^26.6.3": version: 26.6.3 resolution: "jest@npm:26.6.3" dependencies: