fix(core): update
This commit is contained in:
parent
02a0646a49
commit
70a08fd92b
26
test/test.ts
26
test/test.ts
@ -60,23 +60,35 @@ tap.test('should extract a package using tarStream', async (tools) => {
|
|||||||
const extractionFileObservable = await testSmartarchive.extractArchiveFromBufferToObservable(
|
const extractionFileObservable = await testSmartarchive.extractArchiveFromBufferToObservable(
|
||||||
testTgzBuffer
|
testTgzBuffer
|
||||||
);
|
);
|
||||||
const subscription = extractionFileObservable.subscribe(file => {
|
const subscription = extractionFileObservable.subscribe(
|
||||||
|
(file) => {
|
||||||
console.log(file.path);
|
console.log(file.path);
|
||||||
});
|
},
|
||||||
await tools.delayFor(2000);
|
(err) => {
|
||||||
|
console.log(err);
|
||||||
|
},
|
||||||
|
() => {
|
||||||
done.resolve();
|
done.resolve();
|
||||||
|
}
|
||||||
|
);
|
||||||
await done.promise;
|
await done.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should extract a file from url to replaySubject', async (tools) => {
|
tap.test('should extract a file from url to replaySubject', async (tools) => {
|
||||||
const done = tools.defer();
|
const done = tools.defer();
|
||||||
const testSmartarchive = new smartarchive.SmartArchive();
|
const testSmartarchive = new smartarchive.SmartArchive();
|
||||||
const extractionFileObservable = await testSmartarchive.extractArchiveFromUrlToObservable('https://verdaccio.lossless.one/@pushrocks%2fwebsetup/-/websetup-2.0.14.tgz');
|
const extractionFileObservable = await testSmartarchive.extractArchiveFromUrlToObservable(
|
||||||
const subscription = extractionFileObservable.subscribe(file => {
|
'https://verdaccio.lossless.one/@pushrocks%2fwebsetup/-/websetup-2.0.14.tgz'
|
||||||
|
);
|
||||||
|
const subscription = extractionFileObservable.subscribe((file) => {
|
||||||
console.log(file.path);
|
console.log(file.path);
|
||||||
});
|
},
|
||||||
await tools.delayFor(2000);
|
(err) => {
|
||||||
|
console.log(err);
|
||||||
|
},
|
||||||
|
() => {
|
||||||
done.resolve();
|
done.resolve();
|
||||||
|
});
|
||||||
await done.promise;
|
await done.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ export class SmartArchive {
|
|||||||
stream.resume();
|
stream.resume();
|
||||||
});
|
});
|
||||||
extractPipeStop.on('finish', () => {
|
extractPipeStop.on('finish', () => {
|
||||||
replaySubject.unsubscribe();
|
replaySubject.complete();
|
||||||
});
|
});
|
||||||
// lets run the stream
|
// lets run the stream
|
||||||
readableStream
|
readableStream
|
||||||
|
Loading…
Reference in New Issue
Block a user