it("resolves when the destination stream emits finish event", async () => { const pacoteService = setupTest(); const pacoteExtractPackagePromise = pacoteService.extractPackage(packageName, destinationDir); setImmediate(() => { tarExtractDestinationStream.emit("finish"); }); await assert.isFulfilled(pacoteExtractPackagePromise); });
it(testCase.name, async () => { const pacoteService = setupTest(testCase); const pacoteExtractPackagePromise = pacoteService.extractPackage(packageName, destinationDir); setImmediate(() => { tarExtractDestinationStream.emit("finish"); }); await assert.isFulfilled(pacoteExtractPackagePromise); assert.deepEqual(tarballStreamStub.firstCall.args, testCase.expectedArgs); });
it('should pass on missing optional data', () => { context.paths.configFile = './non-existing_____/tsd.json'; core = getCore(context); return assert.isFulfilled(core.config.readConfig(true)); });