Skip to content

Commit

Permalink
test(onezip) improve coverage of progress
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Jan 8, 2021
1 parent 0060e05 commit 41f590c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/extract.js
Expand Up @@ -144,6 +144,7 @@ test('onezip: exract: mkdir: error', async (t) => {
const [{message}] = await once(extracter, 'error');

stopAll();
rimraf.sync(to);

t.equal(message, 'Can not create directory!', 'should not create directory');
t.end();
Expand All @@ -165,8 +166,24 @@ test('onezip: exract: mkdir error on file write', async (t) => {
const extracter = extract(from, to);
const [{message}] = await once(extracter, 'error');

rimraf.sync(to);
stopAll();

t.equal(message, 'Can not create directory!', 'should not create directory');
t.end();
});

test('onezip: exract: mkdir error on file write', async (t) => {
const to = tmpdir();
const from = join(__dirname, 'fixture', '101.zip');

const extracter = extract(from, to);
const [progress] = await once(extracter, 'progress');
await once(extracter, 'end');

stopAll();
rimraf.sync(to);

t.equal(progress, 1);
t.end();
});
Binary file added test/fixture/101.zip
Binary file not shown.

0 comments on commit 41f590c

Please sign in to comment.