Skip to content

Commit

Permalink
Add test for nested files
Browse files Browse the repository at this point in the history
  • Loading branch information
atjn committed Jul 4, 2022
1 parent a56125a commit 43c04af
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,26 @@ tap.test('basic folder', async () => {

});

const nestedFS = Volume.fromJSON(
{
'./8bytes.txt': B.repeat(8),
'./much/empty/path/500bytes.txt': B.repeat(500),
'./much/empty/path/nested/6000bytes.txt': B.repeat(6000),
},
'/fixture',
).promisesApi;

tap.test('nested folder', async () => {

tap.test('get folder size', async () => {

tap.equal(await callAll('/fixture', {fs: nestedFS}), 6508, 'should return the correct folder size');
tap.end();

});

});

const linkedFS = Volume.fromJSON(
{
'./original.txt': B.repeat(50),
Expand Down

0 comments on commit 43c04af

Please sign in to comment.