Closed szwacz closed 8 years ago
Thank you for the PR @szwacz, can you please add some tests?
Well I wanted to, but...
I'd love to add tests, but I'm afraid it requires refactoring on project owners side first, for now adding more tests is a little too hard.
I would like to see this change in npm shortly, and tests refactoring looks like not that much of work, so I can do it, but tell me if you agree to move test zip files from https://drive.google.com/uc?id=0Bxxp2pVhWG1DTFNWQ1hsSkZKZmM&export=download into this repository (and it will make more sense to filter them with .npmignore, so tests will be runnable only by fetching the git repo). Sounds good?
@rayshan :arrow_up:
Sorry I drop the ball on this one. I'm back from vacation now.
@szwacz are you referring to the test assets in bower repo here? https://github.com/bower/bower/tree/master/test/assets
I agree it makes sense for decompress assets and tests to live in this module, however I'm not as familiar with bower CLI architecture and this module. @sheerun or @sindresorhus can you please advise?
@rayshan Decompress-zip project downloads test assets from https://drive.google.com/uc?id=0Bxxp2pVhWG1DTFNWQ1hsSkZKZmM&export=download (see download-test-assets.js
). Those assets looks totally different than that mentioned by you from bower repository.
I see, never mind about what I said. Yes I agree test fixtures should live in this repo just like bower repo's test fixtures. Perhaps the original concern was that the file was too big? If we don't need all the packages in the asset archive, maybe we can remove /angular, which is the bulk of the size.
Also agree on the cross-platform concern, since the team supports the CLI on Windows.
Please make zip files as small as possible when moving :)
Merge conflicts needs to be resolved ;)
Yey! Ok, I'll fix this and add some tests tomorrow or on Tuesday. Please stay tuned ;)
@szwacz I've merged your PR with tests refactor to master and even added coveralls support :)
All right. Here are unit tests.
One more thing... My code doesn't cover case when you extract stuff into nonexistent folder, e.g.
zip.extract({ path: 'completely/new/path' });
Folders completely/new/path don't exist, so DecompressZip will create them, but there is no direct way to set their mode. Of course we can do something like:
zip.extract({ path: 'completely/new/path', modeForNonexistentDirectories: '777' });
But I don't know if this feature will be used at all. What do you think?
Ok, ignore what I've written one comment above. If someone wants to have folders with certain mode he or she could create them bofore unpacking or chmod them after unpacking. It doesn't make sense to add this to DecompressZip.
Ping?
+1 for this PR
+1 could use this!
Fixes https://github.com/bower/decompress-zip/issues/22