Skip to content

Commit 55fd995

Browse files
committed
Fixes non deterministic directory size calculation
The emptySize compared against should be fully calculated before creating our file
1 parent aede969 commit 55fd995

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/files/filesystems/UserFileSystem.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ describe('#getSize', () => {
8686
});
8787

8888
test('Size of directory with text file', async () => {
89-
const emptyFileSystemSize = user.getDefaultFileSystem().getSize();
89+
const emptyFileSystemSize = await user.getDefaultFileSystem().getSize();
9090

9191
await TestHelper.createFile(user.getDefaultFileSystem(), '/root.txt', 'Hello Jester!');
9292
await expect(user.getDefaultFileSystem().getFiles('/')).resolves.toHaveLength(1);
9393

94-
await expect(user.getDefaultFileSystem().getSize()).resolves.toBeGreaterThan(await emptyFileSystemSize);
94+
await expect(user.getDefaultFileSystem().getSize()).resolves.toBeGreaterThan(emptyFileSystemSize);
9595
});
9696
});

0 commit comments

Comments
 (0)