Skip to content

Commit

Permalink
0.4.12 - Created a test to check Twizzeld's issue on Issue #237. (was…
Browse files Browse the repository at this point in the history
… not able to replicate his issue)
  • Loading branch information
cjacobs committed Jun 22, 2018
1 parent d2e7512 commit bdc6eac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Binary file added test/assets/issue-237-Twizzeld.zip
Binary file not shown.
15 changes: 15 additions & 0 deletions test/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ describe('adm-zip', () => {
"./test/xxx/utes_test/New folder/somefile.txt"
].sort());
})

it('passes issue-237-Twizzeld test case', () => {
const zip = new Zip('./test/assets/issue-237-Twizzeld.zip');
const zipEntries = zip.getEntries();
zipEntries.forEach(function (zipEntry) {
if (!zipEntry.isDirectory) {
zip.extractEntryTo(zipEntry, './', false, true);
// This should create text.txt on the desktop.
// It will actually create two, but the first is overwritten by the second.
}
});
let text = fs.readFileSync('./text.txt').toString()
expect(text).to.equal('ride em cowboy!')
fs.unlinkSync('./text.txt')
})
})

function walk(dir) {
Expand Down

0 comments on commit bdc6eac

Please sign in to comment.