Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sinchang committed May 10, 2023
1 parent 802689a commit e67f064
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test.js
Expand Up @@ -334,8 +334,8 @@ test('junk files are ignored', async t => {
t.is(report.completedFiles, 1);
t.is(report.completedSize, 11);
t.is(report.percent, 1);
t.is(report.sourcePath, t.context.tmp + '/cwd/foo');
t.is(report.destinationPath, t.context.tmp + '/cwd/foo');
t.is(read(report.sourcePath), read(t.context.tmp + '/cwd/foo'));
t.is(read(report.destinationPath), read(t.context.tmp + '/cwd/foo'));
});

test('junk files are copied', async t => {
Expand All @@ -358,8 +358,8 @@ test('junk files are copied', async t => {
t.is(report.completedFiles, 2);
t.is(report.completedSize, 22);
t.is(report.percent, 1);
t.is(report.sourcePath, t.context.tmp + '/cwd/foo');
t.is(report.destinationPath, t.context.tmp + '/cwd/foo');
t.is(read(report.sourcePath), read(t.context.tmp + '/cwd/foo'));
t.is(read(report.destinationPath), read(t.context.tmp + '/cwd/foo'));
});

test('nested junk files are ignored', async t => {
Expand All @@ -382,8 +382,8 @@ test('nested junk files are ignored', async t => {
t.is(report.completedFiles, 1);
t.is(report.completedSize, 11);
t.is(report.percent, 1);
t.is(report.sourcePath, t.context.tmp + '/cwd/test');
t.is(report.destinationPath, t.context.tmp + '/test');
t.is(read(report.sourcePath), read(t.context.tmp + '/cwd/test'));
t.is(read(report.destinationPath), read(t.context.tmp + '/test'));
});

test('reports copy progress of single file', async t => {
Expand All @@ -404,8 +404,8 @@ test('reports copy progress of single file', async t => {
t.is(report.completedFiles, 1);
t.is(report.completedSize, 11);
t.is(report.percent, 1);
t.is(report.sourcePath, t.context.tmp + '/cwd/foo');
t.is(report.destinationPath, t.context.tmp + '/foo');
t.is(read(report.sourcePath), read(t.context.tmp + '/cwd/foo'));
t.is(read(report.destinationPath), read(t.context.tmp + '/foo'));
});

test('reports copy progress of multiple files', async t => {
Expand All @@ -427,8 +427,8 @@ test('reports copy progress of multiple files', async t => {
t.is(report.completedFiles, 2);
t.is(report.completedSize, 25);
t.is(report.percent, 1);
t.is(report.sourcePath, t.context.tmp + '/cwd/bar');
t.is(report.destinationPath, t.context.tmp + '/bar');
t.is(read(report.sourcePath), read(t.context.tmp + '/cwd/bar'));
t.is(read(report.destinationPath), read(t.context.tmp + '/bar'));
});

test('reports correct completedSize', async t => {
Expand All @@ -453,8 +453,8 @@ test('reports correct completedSize', async t => {
t.is(report.totalFiles, 1);
t.is(report.completedFiles, 1);
t.is(report.completedSize, ONE_MEGABYTE);
t.is(report.sourcePath, t.context.tmp + '/cwd/fatfile');
t.is(report.destinationPath, t.context.tmp + '/fatfile');
t.is(read(report.sourcePath), read(t.context.tmp, 'cwd/fatfile'));
t.is(read(report.destinationPath), read(t.context.tmp, 'fatfile'));
t.true(chunkCount > 1);
t.is(report.percent, 1);
});
Expand Down

0 comments on commit e67f064

Please sign in to comment.