mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-26 02:53:21 +00:00
Adopt Commonlib 0.2.0 with injected device storage
This commit is contained in:
1 parent
e56098eb57
commit
96ad2737a7
60 files changed
+1499
-541
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
decodeSettingsFromSetupURI,
|
||||
DEFAULT_SETTINGS,
|
||||
PREFERRED_SETTING_SELF_HOSTED,
|
||||
} from "../setup/livesync-commonlib.ts";
|
||||
|
||||
function assert(condition: unknown, message: string): asserts condition {
|
||||
@@ -38,7 +39,9 @@ Deno.test("generates a current self-hosted Setup URI through the published Commo
|
||||
const recoveryCode = stdout.match(/sls-id-v1:[0-9a-f]{64}/u)?.[0];
|
||||
assert(recoveryCode, "the generator did not print an ID recovery code");
|
||||
assert(
|
||||
(effectiveSettings as typeof effectiveSettings & { idDerivationKey?: string }).idDerivationKey ===
|
||||
(effectiveSettings as typeof effectiveSettings & {
|
||||
idDerivationKey?: string;
|
||||
}).idDerivationKey ===
|
||||
recoveryCode.slice("sls-id-v1:".length),
|
||||
"the CouchDB Setup URI did not contain the generated ID key",
|
||||
);
|
||||
@@ -47,8 +50,9 @@ Deno.test("generates a current self-hosted Setup URI through the published Commo
|
||||
"the CouchDB Setup URI left the imported device unconfigured",
|
||||
);
|
||||
assert(
|
||||
effectiveSettings.customChunkSize === 60,
|
||||
"the Setup URI did not use the current self-hosted chunk-size recommendation",
|
||||
effectiveSettings.customChunkSize ===
|
||||
PREFERRED_SETTING_SELF_HOSTED.customChunkSize,
|
||||
"the Setup URI did not use the self-hosted chunk-size preference from Commonlib",
|
||||
);
|
||||
assert(
|
||||
effectiveSettings.chunkSplitterVersion === "v3-rabin-karp",
|
||||
|
||||
Reference in new issue
Block a user