mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-23 22:27:34 -05:00
3838d3d212
* chore: clean lint warnings * refactor: move core packages
29 lines
803 B
TypeScript
29 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);
|
|
});
|
|
});
|