1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-08 23:25:51 +01:00

fix: #1191 overrides existing package to 0 bytes file

This commit is contained in:
Juan Picado @jotadeveloper 2019-02-24 10:26:43 +01:00
parent e143b7d0fe
commit 783fbce060
No known key found for this signature in database
GPG Key ID: 18AC54485952D158
3 changed files with 1 additions and 7 deletions

@ -16,7 +16,7 @@
},
"dependencies": {
"@verdaccio/file-locking": "0.0.8",
"@verdaccio/local-storage": "2.0.0-beta.1",
"@verdaccio/local-storage": "2.0.0-beta.2",
"@verdaccio/streams": "2.0.0-beta.0",
"JSONStream": "1.3.5",
"async": "3.0.1-0",

@ -363,16 +363,10 @@ describe('LocalStorage', () => {
test('should fails on add a duplicated new tarball ', (done) => {
const tarballData = JSON.parse(readMetadata('addTarball'));
const stream = storage.addTarball(pkgName, tarballName);
let spy;
// $FlowFixMe
spy = jest.spyOn(stream && stream._readableState && stream._readableState.pipes, 'abort');
stream.on('error', (err) => {
expect(err).not.toBeNull();
expect(err.statusCode).toEqual(HTTP_STATUS.CONFLICT);
expect(err.message).toMatch(/this package is already present/);
});
stream.on('success', function(){
expect(spy).toHaveBeenCalled();
done();
});
stream.end(new Buffer(tarballData.data, 'base64'));

BIN
yarn.lock

Binary file not shown.