Пример #1
0
		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);
		});
Пример #2
0
				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);
				});
Пример #3
0
		it('should pass on missing optional data', () => {
			context.paths.configFile = './non-existing_____/tsd.json';
			core = getCore(context);
			return assert.isFulfilled(core.config.readConfig(true));
		});