Fix folder deletion (#140)
This commit is contained in:
parent
aa73a5d718
commit
1ddba47b80
9 changed files with 69 additions and 25 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue