works
This commit is contained in:
parent
408afa3626
commit
e3196c2dc0
2 changed files with 337 additions and 300 deletions
|
|
@ -83,8 +83,6 @@ export class MockAgent extends MockClient {
|
|||
}
|
||||
|
||||
public async act(): Promise<void> {
|
||||
this.assertAllContentIsPresentOnce();
|
||||
|
||||
const options: (() => Promise<unknown>)[] = [
|
||||
this.createFileAction.bind(this),
|
||||
this.changeFetchChangesUpdateIntervalMsAction.bind(this)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { assert } from "../utils/assert";
|
||||
import type {
|
||||
RelativePath,
|
||||
FileSystemOperations,
|
||||
|
|
@ -81,6 +82,18 @@ export class MockClient implements FileSystemOperations {
|
|||
const newContentUint8Array = new TextEncoder().encode(newContent);
|
||||
this.localFiles.set(path, newContentUint8Array);
|
||||
|
||||
const existingPats = currentContent
|
||||
.split(" ")
|
||||
.map((part) => part.trim());
|
||||
const newParts = newContent.split(" ").map((part) => part.trim());
|
||||
existingPats.forEach((part) =>
|
||||
// all changes should be additive
|
||||
assert(
|
||||
newParts.includes(part),
|
||||
`Part ${part} not found in new content`
|
||||
)
|
||||
);
|
||||
|
||||
this.client.logger.info(
|
||||
`Updated file ${path} with:\n current content: ${currentContent}\n new content: ${newContent}`
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue