diff --git a/test/assets/issue-237-Twizzeld.zip b/test/assets/issue-237-Twizzeld.zip new file mode 100644 index 0000000..6155645 Binary files /dev/null and b/test/assets/issue-237-Twizzeld.zip differ diff --git a/test/mocha.js b/test/mocha.js index 7b55fde..755e620 100644 --- a/test/mocha.js +++ b/test/mocha.js @@ -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) {