ff21ec921a
The test runner bundles TypeScript tests with esbuild and executes them using Node's built-in test runner. Tests cover document downloader behavior, path utilities, rmapi bridge configuration, style refinement, and ZIP file handling. Mock implementations for Obsidian plugin interfaces enable isolated unit testing.
27 lines
641 B
TypeScript
27 lines
641 B
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { join } from "path";
|
|
import { RmapiBridge } from "../src/rmapi/bridge";
|
|
|
|
test("RmapiBridge stores rmapi config under the vault .obsidian folder", () => {
|
|
const plugin = {
|
|
settings: {
|
|
remarkableHost: "https://10.11.99.1",
|
|
},
|
|
app: {
|
|
vault: {
|
|
adapter: {
|
|
getBasePath: () => "/tmp/vault",
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
const bridge: any = new RmapiBridge(plugin as any);
|
|
|
|
assert.deepEqual(bridge.getEnv(), {
|
|
RMAPI_HOST: "https://10.11.99.1",
|
|
RMAPI_CONFIG: join("/tmp/vault", ".obsidian", "rmapi"),
|
|
});
|
|
});
|