mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
3838d3d212
* chore: clean lint warnings * refactor: move core packages
30 lines
803 B
TypeScript
30 lines
803 B
TypeScript
import { ReadTarball, UploadTarball } from '../src/index';
|
|
|
|
describe('mystreams', () => {
|
|
test('should delay events on ReadTarball abort', (cb) => {
|
|
const readTballStream = new ReadTarball({});
|
|
readTballStream.abort();
|
|
setTimeout(function () {
|
|
readTballStream.abort = function (): void {
|
|
cb();
|
|
};
|
|
readTballStream.abort = function (): never {
|
|
throw Error('fail');
|
|
};
|
|
}, 10);
|
|
});
|
|
|
|
test('should delay events on UploadTarball abort', (cb) => {
|
|
const uploadTballStream = new UploadTarball({});
|
|
uploadTballStream.abort();
|
|
setTimeout(function () {
|
|
uploadTballStream.abort = function (): void {
|
|
cb();
|
|
};
|
|
uploadTballStream.abort = function (): never {
|
|
throw Error('fail');
|
|
};
|
|
}, 10);
|
|
});
|
|
});
|