broccoli-test-helper
Version:
Test helpers for BroccoliPlugins that make testing build and rebuild behavior dead simple and expect diff friendly.
18 lines (14 loc) • 434 B
text/typescript
import { Changes } from "./interfaces";
import { diffEntries, FSTree, readEntries } from "./util";
export default class TreeDiff {
public changes: Changes = {};
private previous: FSTree;
constructor(private path: string) {
this.previous = readEntries(path);
}
public diff(): void {
const current = readEntries(this.path);
this.changes = diffEntries(current, this.previous);
this.previous = current;
}
}