Fix folder deletion (#140)

This commit is contained in:
Andras Schmelczer 2025-10-20 20:24:35 +01:00 committed by GitHub
parent aa73a5d718
commit 1ddba47b80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 69 additions and 25 deletions

View file

@ -94,7 +94,7 @@ export class MockAgent extends MockClient {
options.push(this.enableSyncAction.bind(this));
}
const files = await this.listAllFiles();
const files = await this.listFilesRecursively();
if (files.length > 0) {
options.push(

View file

@ -7,6 +7,7 @@ import {
SyncClient
} from "sync-client";
import type { TextWithCursors } from "reconcile-text";
export class MockClient implements FileSystemOperations {
protected readonly localFiles = new Map<string, Uint8Array>();
protected client!: SyncClient;
@ -46,7 +47,9 @@ export class MockClient implements FileSystemOperations {
await this.client.start();
}
public async listAllFiles(): Promise<RelativePath[]> {
public async listFilesRecursively(
_root: RelativePath | undefined = undefined // we don't use multi-level paths during tests
): Promise<RelativePath[]> {
return Array.from(this.localFiles.keys());
}