You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-20 23:30:05 +02:00
tets
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { syncDir, synchronizer, supportDir, loadEncryptionMasterKey, setupDatabaseAndSynchronizer, switchClient } from '../testing/test-utils';
|
||||
import { syncDir, synchronizer, supportDir, loadEncryptionMasterKey, setupDatabaseAndSynchronizer, switchClient, synchronizerStart } from '../testing/test-utils';
|
||||
import Setting from '../models/Setting';
|
||||
import Folder from '../models/Folder';
|
||||
import Note from '../models/Note';
|
||||
@@ -8,6 +8,8 @@ import markdownUtils from '../markdownUtils';
|
||||
import shim from '../shim';
|
||||
import * as fs from 'fs-extra';
|
||||
import { setEncryptionEnabled } from '../services/synchronizer/syncTargetInfoUtils';
|
||||
const { shimInit } = require('../shim-init-node');
|
||||
const sharp = require('sharp');
|
||||
|
||||
const snapshotBaseDir = `${supportDir}/syncTargetSnapshots`;
|
||||
|
||||
@@ -106,6 +108,8 @@ export async function deploySyncTargetSnapshot(syncTargetType: string, syncVersi
|
||||
}
|
||||
|
||||
export async function main(syncTargetType: string) {
|
||||
shimInit(sharp);
|
||||
|
||||
const validSyncTargetTypes = ['normal', 'e2ee'];
|
||||
if (!validSyncTargetTypes.includes(syncTargetType)) throw new Error(`Sync target type must be: ${validSyncTargetTypes.join(', ')}`);
|
||||
|
||||
@@ -118,6 +122,8 @@ export async function main(syncTargetType: string) {
|
||||
await loadEncryptionMasterKey();
|
||||
}
|
||||
|
||||
await synchronizerStart();
|
||||
|
||||
await synchronizer().start();
|
||||
|
||||
if (!Setting.value('syncVersion')) throw new Error('syncVersion is not set');
|
||||
|
||||
@@ -138,6 +138,7 @@ function setSyncTargetName(name: string) {
|
||||
}
|
||||
|
||||
setSyncTargetName('memory');
|
||||
// setSyncTargetName('filesystem');
|
||||
// setSyncTargetName('nextcloud');
|
||||
// setSyncTargetName('dropbox');
|
||||
// setSyncTargetName('onedrive');
|
||||
@@ -153,7 +154,7 @@ const syncDir = `${oldTestDir}/sync/${suiteName_}`;
|
||||
// anyway.
|
||||
let defaultJestTimeout = 90 * 1000;
|
||||
if (isNetworkSyncTarget_) defaultJestTimeout = 60 * 1000 * 10;
|
||||
jest.setTimeout(defaultJestTimeout);
|
||||
if (typeof jest !== 'undefined') jest.setTimeout(defaultJestTimeout);
|
||||
|
||||
const dbLogger = new Logger();
|
||||
dbLogger.addTarget(TargetType.Console);
|
||||
@@ -170,7 +171,7 @@ BaseItem.loadClass('Folder', Folder);
|
||||
BaseItem.loadClass('Resource', Resource);
|
||||
BaseItem.loadClass('Tag', Tag);
|
||||
BaseItem.loadClass('NoteTag', NoteTag);
|
||||
// BaseItem.loadClass('MasterKey', MasterKey);
|
||||
BaseItem.loadClass('MasterKey', MasterKey);
|
||||
BaseItem.loadClass('Revision', Revision);
|
||||
|
||||
Setting.setConstant('appId', 'net.cozic.joplintest-cli');
|
||||
|
||||
Reference in New Issue
Block a user