Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

修正测试伪造ino方式

DavidShene32285a7423c
diff --git a/apps/desktop/src/main/cindy-brain/__tests__/saveDeposit.test.ts b/apps/desktop/src/main/cindy-brain/__tests__/saveDeposit.test.ts
index b6027bfca4..71b6711ec5 100644
--- a/apps/desktop/src/main/cindy-brain/__tests__/saveDeposit.test.ts
+++ b/apps/desktop/src/main/cindy-brain/__tests__/saveDeposit.test.ts
@@ -90,9 +90,13 @@ describe('SaveDepositVault', () => {
const originalStatSync = fs.statSync.bind(fs);
const statSpy = vi.spyOn(fs, 'statSync').mockImplementationOnce((filePath) => {
const stat = originalStatSync(filePath);
- return Object.assign(Object.create(Object.getPrototypeOf(stat)), stat, {
- ino: stat.ino + 1,
- }) as fs.Stats;
+ const tamperedIno = stat.ino === 0 ? 1 : 0;
+ return new Proxy(stat, {
+ get(target, property, receiver) {
+ if (property === 'ino') return tamperedIno;
+ return Reflect.get(target, property, receiver);
+ },
+ });
});
try {
await expect(