diff --git a/package.json b/package.json index 77c5453f4..364763e3b 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,12 @@ }, "license": "MIT", "scripts": { + "addPackageCli": "lerna add --scope joplin", + "addPackageCliD": "lerna add --scope joplin -D", + "addPackageDesktop": "lerna add --scope @joplin/app-desktop", + "addPackageDesktopD": "lerna add --scope @joplin/app-desktop -D", + "addPackageMobile": "lerna add --scope @joplin/app-mobile", + "addPackageMobileD": "lerna add --scope @joplin/app-mobile -D", "buildApiDoc": "npm start --prefix=packages/app-cli -- apidoc ../../readme/api/references/rest_api.md", "buildDoc": "./packages/tools/build-all.sh", "buildPluginDoc": "typedoc --name 'Joplin Plugin API Documentation' --mode file -theme './Assets/PluginDocTheme/' --readme './Assets/PluginDocTheme/index.md' --excludeNotExported --excludeExternals --excludePrivate --excludeProtected --out docs/api/references/plugin_api packages/lib/services/plugins/api/", @@ -26,11 +32,11 @@ "releaseDesktop": "node packages/tools/release-electron.js", "releasePluginGenerator": "node packages/tools/release-plugin-generator.js", "setupNewRelease": "node ./packages/tools/setupNewRelease", - "updatePluginTypes": "./packages/generator-joplin/updateTypes.sh", - "tsc": "lerna run tsc --stream --parallel", - "test": "lerna run test --stream", "test-ci": "lerna run test-ci --stream", + "test": "lerna run test --stream", + "tsc": "lerna run tsc --stream --parallel", "updateIgnored": "gulp updateIgnoredTypeScriptBuild", + "updatePluginTypes": "./packages/generator-joplin/updateTypes.sh", "watch": "lerna run watch --stream --parallel" }, "husky": { diff --git a/packages/app-cli/package-lock.json b/packages/app-cli/package-lock.json index f415e28e4..458104674 100644 --- a/packages/app-cli/package-lock.json +++ b/packages/app-cli/package-lock.json @@ -898,11 +898,15 @@ "@types/istanbul-lib-report": "*" } }, - "@types/jasmine": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.6.0.tgz", - "integrity": "sha512-CPT4r0a63e5wpNj5ejMnconM7a+0Hdx6/APsyw8AQOHk0/Mxp3xYrym1ZabWJiYuQkgKB3MonYoN04mxtvAvRA==", - "dev": true + "@types/jest": { + "version": "26.0.15", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.15.tgz", + "integrity": "sha512-s2VMReFXRg9XXxV+CW9e5Nz8fH2K1aEhwgjUqPPbQd7g95T0laAcvLv032EhFHIa5GHsZ8W7iJEQVaJq6k3Gog==", + "dev": true, + "requires": { + "jest-diff": "^26.0.0", + "pretty-format": "^26.0.0" + } }, "@types/node": { "version": "14.14.6", @@ -4511,38 +4515,6 @@ "istanbul-lib-report": "^3.0.0" } }, - "jasmine": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.5.0.tgz", - "integrity": "sha512-DYypSryORqzsGoMazemIHUfMkXM7I7easFaxAvNM3Mr6Xz3Fy36TupTrAOxZWN8MVKEU5xECv22J4tUQf3uBzQ==", - "dev": true, - "requires": { - "glob": "^7.1.4", - "jasmine-core": "~3.5.0" - }, - "dependencies": { - "glob": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", - "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, - "jasmine-core": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.5.0.tgz", - "integrity": "sha512-nCeAiw37MIMA9w9IXso7bRaLl+c/ef3wnxsoSAlYrzS+Ot0zTG6nU8G/cIfGkqpkjX2wNaIW9RFG0TwIFnG6bA==", - "dev": true - }, "jest": { "version": "26.6.3", "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", diff --git a/packages/app-cli/package.json b/packages/app-cli/package.json index 1ee8fe013..42f67e07c 100644 --- a/packages/app-cli/package.json +++ b/packages/app-cli/package.json @@ -66,6 +66,7 @@ }, "devDependencies": { "@joplin/tools": "^1.0.9", + "@types/jest": "^26.0.15", "@types/node": "^14.14.6", "gulp": "^4.0.2", "jest": "^26.6.3", diff --git a/packages/app-cli/tests/models_Note.ts b/packages/app-cli/tests/models_Note.ts index 429c18591..c0082f6e2 100644 --- a/packages/app-cli/tests/models_Note.ts +++ b/packages/app-cli/tests/models_Note.ts @@ -262,14 +262,14 @@ describe('models_Note', function() { for (const testCase of testCases) { const [useAbsolutePaths, input, expected] = testCase; const internalToExternal = await Note.replaceResourceInternalToExternalLinks(input, { useAbsolutePaths }); - expect(internalToExternal).toBe(expected, 'replaceResourceInternalToExternalLinks failed'); + expect(internalToExternal).toBe(expected); const externalToInternal = await Note.replaceResourceExternalToInternalLinks(internalToExternal, { useAbsolutePaths }); - expect(externalToInternal).toBe(input, 'replaceResourceExternalToInternalLinks failed'); + expect(externalToInternal).toBe(input); } const result = await Note.replaceResourceExternalToInternalLinks(`[](joplin://${note1.id})`); - expect(result).toBe(`[](:/${note1.id})`, 'replaceResourceExternalToInternalLinks failed (note link)'); + expect(result).toBe(`[](:/${note1.id})`); })); }); diff --git a/packages/app-cli/tests/services_InteropService.ts b/packages/app-cli/tests/services_InteropService.ts index ee4a6c666..6d147bdde 100644 --- a/packages/app-cli/tests/services_InteropService.ts +++ b/packages/app-cli/tests/services_InteropService.ts @@ -28,7 +28,7 @@ async function recreateExportDir() { function fieldsEqual(model1: any, model2: any, fieldNames: string[]) { for (let i = 0; i < fieldNames.length; i++) { const f = fieldNames[i]; - expect(model1[f]).toBe(model2[f], `For key ${f}`); + expect(model1[f]).toBe(model2[f]); } }