1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Desktop, Mobile, Cli: Allow setting a minimum app version on the sync target (#9778)

This commit is contained in:
Laurent Cozic
2024-01-26 10:32:35 +00:00
committed by GitHub
parent 2cc4ac087b
commit 7b06090255
12 changed files with 166 additions and 10 deletions

View File

@ -723,7 +723,7 @@ async function checkThrowAsync(asyncFn: Function) {
}
// eslint-disable-next-line @typescript-eslint/ban-types -- Old code before rule was applied
async function expectThrow(asyncFn: Function, errorCode: any = undefined) {
async function expectThrow(asyncFn: Function, errorCode: any = undefined, errorMessage: string = undefined) {
let hasThrown = false;
let thrownError = null;
try {
@ -735,6 +735,12 @@ async function expectThrow(asyncFn: Function, errorCode: any = undefined) {
if (!hasThrown) {
expect('not throw').toBe('throw');
} else if (errorMessage !== undefined) {
if (thrownError.message !== errorMessage) {
expect(`error message: ${thrownError.message}`).toBe(`error message: ${errorMessage}`);
} else {
expect(true).toBe(true);
}
} else if (thrownError.code !== errorCode) {
console.error(thrownError);
expect(`error code: ${thrownError.code}`).toBe(`error code: ${errorCode}`);