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:
parent
e143b7d0fe
commit
783fbce060
@ -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
BIN
yarn.lock
Binary file not shown.
Loading…
Reference in New Issue
Block a user