mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-11-01 13:58:18 +00:00
Migrate CLI E2E tests to Node.js 26
Run the CLI subprocess suites and benchmark tools as native TypeScript with node:test, and move them under test/e2e-cli. Update CI and Compose runners, run local smoke tests on Linux, macOS, and Windows, and collect source-mapped CLI coverage with c8.
This commit is contained in:
1 parent
a0987016bb
commit
2433d117c2
91 files changed
+2219
-1615
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
|
||||
/** A temporary directory which is removed when its `await using` scope ends. */
|
||||
export class TempDir implements AsyncDisposable {
|
||||
readonly path: string;
|
||||
private constructor(path: string) {
|
||||
this.path = path;
|
||||
}
|
||||
static async create(prefix = "livesync-node-test"): Promise<TempDir> {
|
||||
return new TempDir(await mkdtemp(join(tmpdir(), `${prefix}.`)));
|
||||
}
|
||||
join(...parts: string[]): string {
|
||||
return join(this.path, ...parts);
|
||||
}
|
||||
async [Symbol.asyncDispose](): Promise<void> {
|
||||
await rm(this.path, { recursive: true, force: true }).catch(() => {});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user