1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/packages/core/streams/test/mystreams.test.ts
Juan Picado 3838d3d212 feat: relocate core packages (#1906)
* chore: clean lint warnings

* refactor: move core packages
2021-04-09 17:54:13 +02:00

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);
});
});