Skip to content

Commit 43c04af

Browse files
committed
Add test for nested files
1 parent a56125a commit 43c04af

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/logic.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,26 @@ tap.test('basic folder', async () => {
6464

6565
});
6666

67+
const nestedFS = Volume.fromJSON(
68+
{
69+
'./8bytes.txt': B.repeat(8),
70+
'./much/empty/path/500bytes.txt': B.repeat(500),
71+
'./much/empty/path/nested/6000bytes.txt': B.repeat(6000),
72+
},
73+
'/fixture',
74+
).promisesApi;
75+
76+
tap.test('nested folder', async () => {
77+
78+
tap.test('get folder size', async () => {
79+
80+
tap.equal(await callAll('/fixture', {fs: nestedFS}), 6508, 'should return the correct folder size');
81+
tap.end();
82+
83+
});
84+
85+
});
86+
6787
const linkedFS = Volume.fromJSON(
6888
{
6989
'./original.txt': B.repeat(50),

0 commit comments

Comments
 (0)