Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cucumber/cucumber

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cucumber/cucumber - npm Package Compare versions

Comparing version 8.5.3 to 8.6.0

lib/api/console_logger.d.ts

1

lib/api/environment.js

@@ -10,2 +10,3 @@ "use strict";

env: process.env,
debug: false,
}, provided);

@@ -12,0 +13,0 @@ }

4

lib/api/formatters.d.ts
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { IFormatterStream } from '../formatter';

@@ -9,2 +8,3 @@ import { EventEmitter } from 'events';

import { IRunOptionsFormats } from './types';
import { ILogger } from '../logger';
export declare function initializeFormatters({ env, cwd, stdout, logger, onStreamError, eventBroadcaster, eventDataCollector, configuration, supportCodeLibrary, }: {

@@ -15,3 +15,3 @@ env: NodeJS.ProcessEnv;

stderr: IFormatterStream;
logger: Console;
logger: ILogger;
onStreamError: () => void;

@@ -18,0 +18,0 @@ eventBroadcaster: EventEmitter;

@@ -1,4 +0,4 @@

/// <reference types="node" />
import { Envelope, GherkinDocument, IdGenerator, Location, ParseError, Pickle } from '@cucumber/messages';
import { ISourcesCoordinates } from './types';
import { ILogger } from '../logger';
interface PickleWithDocument {

@@ -12,3 +12,3 @@ gherkinDocument: GherkinDocument;

cwd: string;
logger: Console;
logger: ILogger;
unexpandedFeaturePaths: string[];

@@ -15,0 +15,0 @@ featurePaths: string[];

@@ -9,2 +9,3 @@ "use strict";

const environment_1 = require("./environment");
const console_logger_1 = require("./console_logger");
/**

@@ -19,8 +20,16 @@ * Load user-authored configuration to be used in a test run.

var _a;
const { cwd, env } = (0, environment_1.mergeEnvironment)(environment);
const { cwd, stderr, env, debug } = (0, environment_1.mergeEnvironment)(environment);
const logger = new console_logger_1.ConsoleLogger(stderr, debug);
const configFile = (_a = options.file) !== null && _a !== void 0 ? _a : (0, locate_file_1.locateFile)(cwd);
if (configFile) {
logger.debug(`Configuration will be loaded from "${configFile}"`);
}
else {
logger.debug('No configuration file found');
}
const profileConfiguration = configFile
? await (0, configuration_1.fromFile)(cwd, configFile, options.profiles)
? await (0, configuration_1.fromFile)(logger, cwd, configFile, options.profiles)
: {};
const original = (0, configuration_1.mergeConfigurations)(configuration_1.DEFAULT_CONFIGURATION, profileConfiguration, options.provided);
logger.debug('Resolved configuration:', original);
(0, validate_configuration_1.validateConfiguration)(original);

@@ -27,0 +36,0 @@ const runnable = await (0, convert_configuration_1.convertConfiguration)(original, env);

@@ -6,5 +6,5 @@ "use strict";

const messages_1 = require("@cucumber/messages");
const console_1 = require("console");
const environment_1 = require("./environment");
const gherkin_1 = require("./gherkin");
const console_logger_1 = require("./console_logger");
/**

@@ -18,6 +18,6 @@ * Load and parse features, produce a filtered and ordered test plan and/or parse errors.

async function loadSources(coordinates, environment = {}) {
const { cwd, stderr } = (0, environment_1.mergeEnvironment)(environment);
const logger = new console_1.Console(stderr);
const { cwd, stderr, debug } = (0, environment_1.mergeEnvironment)(environment);
const logger = new console_logger_1.ConsoleLogger(stderr, debug);
const newId = messages_1.IdGenerator.uuid();
const { unexpandedFeaturePaths, featurePaths } = await (0, paths_1.resolvePaths)(cwd, coordinates);
const { unexpandedFeaturePaths, featurePaths } = await (0, paths_1.resolvePaths)(logger, cwd, coordinates);
if (featurePaths.length === 0) {

@@ -24,0 +24,0 @@ return {

@@ -8,2 +8,3 @@ "use strict";

const environment_1 = require("./environment");
const console_logger_1 = require("./console_logger");
/**

@@ -17,5 +18,6 @@ * Load support code for use in test runs.

async function loadSupport(options, environment = {}) {
const { cwd } = (0, environment_1.mergeEnvironment)(environment);
const { cwd, stderr, debug } = (0, environment_1.mergeEnvironment)(environment);
const logger = new console_logger_1.ConsoleLogger(stderr, debug);
const newId = messages_1.IdGenerator.uuid();
const { requirePaths, importPaths } = await (0, paths_1.resolvePaths)(cwd, options.sources, options.support);
const { requirePaths, importPaths } = await (0, paths_1.resolvePaths)(logger, cwd, options.sources, options.support);
return await (0, support_1.getSupportCodeLibrary)({

@@ -22,0 +24,0 @@ cwd,

import { ISourcesCoordinates, ISupportCodeCoordinates } from './types';
export declare function resolvePaths(cwd: string, sources: Pick<ISourcesCoordinates, 'paths'>, support?: ISupportCodeCoordinates): Promise<{
import { ILogger } from '../logger';
export declare function resolvePaths(logger: ILogger, cwd: string, sources: Pick<ISourcesCoordinates, 'paths'>, support?: ISupportCodeCoordinates): Promise<{
unexpandedFeaturePaths: string[];

@@ -4,0 +5,0 @@ featurePaths: string[];

@@ -11,3 +11,3 @@ "use strict";

const fs_1 = __importDefault(require("mz/fs"));
async function resolvePaths(cwd, sources, support = {
async function resolvePaths(logger, cwd, sources, support = {
requireModules: [],

@@ -19,3 +19,6 @@ requirePaths: [],

const featurePaths = await expandFeaturePaths(cwd, unexpandedFeaturePaths);
logger.debug('Found feature files based on configuration:', featurePaths);
const { requirePaths, importPaths } = await deriveSupportPaths(cwd, featurePaths, support.requirePaths, support.importPaths);
logger.debug('Found support files to load via `require` based on configuration:', requirePaths);
logger.debug('Found support files to load via `import` based on configuration:', importPaths);
return {

@@ -22,0 +25,0 @@ unexpandedFeaturePaths,

@@ -1,4 +0,4 @@

/// <reference types="node" />
import { PluginManager } from '../plugin';
import { IRunEnvironment, IRunOptions } from './types';
export declare function initializePlugins(logger: Console, configuration: IRunOptions, environment: IRunEnvironment): Promise<PluginManager>;
import { ILogger } from '../logger';
export declare function initializePlugins(logger: ILogger, configuration: IRunOptions, environment: IRunEnvironment): Promise<PluginManager>;

@@ -12,6 +12,6 @@ "use strict";

const support_1 = require("./support");
const console_1 = require("console");
const environment_1 = require("./environment");
const gherkin_1 = require("./gherkin");
const plugins_1 = require("./plugins");
const console_logger_1 = require("./console_logger");
/**

@@ -26,4 +26,4 @@ * Execute a Cucumber test run.

async function runCucumber(configuration, environment = {}, onMessage) {
const { cwd, stdout, stderr, env } = (0, environment_1.mergeEnvironment)(environment);
const logger = new console_1.Console(stderr);
const { cwd, stdout, stderr, env, debug } = (0, environment_1.mergeEnvironment)(environment);
const logger = new console_logger_1.ConsoleLogger(stderr, debug);
const newId = messages_1.IdGenerator.uuid();

@@ -33,3 +33,3 @@ const supportCoordinates = 'World' in configuration.support

: configuration.support;
const { unexpandedFeaturePaths, featurePaths, requirePaths, importPaths } = await (0, paths_1.resolvePaths)(cwd, configuration.sources, supportCoordinates);
const { unexpandedFeaturePaths, featurePaths, requirePaths, importPaths } = await (0, paths_1.resolvePaths)(logger, cwd, configuration.sources, supportCoordinates);
const supportCodeLibrary = 'World' in configuration.support

@@ -36,0 +36,0 @@ ? configuration.support

/// <reference types="node" />
/// <reference types="node" />
import { IRuntime } from '../runtime';

@@ -9,5 +8,6 @@ import { EventEmitter } from 'events';

import { IRunOptionsRuntime } from './types';
import { ILogger } from '../logger';
export declare function makeRuntime({ cwd, logger, eventBroadcaster, eventDataCollector, pickleIds, newId, supportCodeLibrary, requireModules, requirePaths, importPaths, options: { parallel, ...options }, }: {
cwd: string;
logger: Console;
logger: ILogger;
eventBroadcaster: EventEmitter;

@@ -14,0 +14,0 @@ eventDataCollector: EventDataCollector;

@@ -152,2 +152,6 @@ /// <reference types="node" />

env?: NodeJS.ProcessEnv;
/**
* Whether debug logging is enabled.
*/
debug?: boolean;
}

@@ -154,0 +158,0 @@ /**

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { EventEmitter } from 'events';

@@ -12,2 +11,3 @@ import PickleFilter from '../pickle_filter';

import { PickleOrder } from '../models/pickle_order';
import { ILogger } from '../logger';
interface IParseGherkinMessageStreamRequest {

@@ -33,3 +33,3 @@ cwd?: string;

export declare function parseGherkinMessageStream({ eventBroadcaster, eventDataCollector, gherkinMessageStream, order, pickleFilter, }: IParseGherkinMessageStreamRequest): Promise<string[]>;
export declare function orderPickles<T = string>(pickleIds: T[], order: PickleOrder, logger: Console): void;
export declare function orderPickles<T = string>(pickleIds: T[], order: PickleOrder, logger: ILogger): void;
export declare function emitMetaMessage(eventBroadcaster: EventEmitter, env: NodeJS.ProcessEnv): Promise<void>;

@@ -36,0 +36,0 @@ export declare function emitSupportCodeMessages({ eventBroadcaster, supportCodeLibrary, newId, }: {

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -7,2 +10,3 @@ const configuration_1 = require("../configuration");

const install_validator_1 = require("./install_validator");
const debug_1 = __importDefault(require("debug"));
class Cli {

@@ -40,2 +44,3 @@ constructor({ argv, cwd, stdout, stderr = process.stderr, env, }) {

env: this.env,
debug: debug_1.default.enabled('cucumber'),
};

@@ -42,0 +47,0 @@ const { useConfiguration: configuration, runConfiguration } = await (0, api_1.loadConfiguration)({

import { IConfiguration } from './types';
export declare function fromFile(cwd: string, file: string, profiles?: string[]): Promise<Partial<IConfiguration>>;
import { ILogger } from '../logger';
export declare function fromFile(logger: ILogger, cwd: string, file: string, profiles?: string[]): Promise<Partial<IConfiguration>>;

@@ -15,8 +15,10 @@ "use strict";

const { importer } = require('../importer');
async function fromFile(cwd, file, profiles = []) {
async function fromFile(logger, cwd, file, profiles = []) {
const definitions = await loadFile(cwd, file);
if (!definitions.default) {
logger.debug('No default profile defined in configuration file');
definitions.default = {};
}
if (profiles.length < 1) {
logger.debug('No profiles specified; using default profile');
profiles = ['default'];

@@ -30,3 +32,3 @@ }

});
return (0, merge_configurations_1.mergeConfigurations)({}, ...profiles.map((profileKey) => extractConfiguration(profileKey, definitions[profileKey])));
return (0, merge_configurations_1.mergeConfigurations)({}, ...profiles.map((profileKey) => extractConfiguration(logger, profileKey, definitions[profileKey])));
}

@@ -54,4 +56,5 @@ exports.fromFile = fromFile;

}
function extractConfiguration(name, definition) {
function extractConfiguration(logger, name, definition) {
if (typeof definition === 'string') {
logger.debug(`Profile "${name}" value is a string; parsing as argv`);
const { configuration } = argv_parser_1.default.parse([

@@ -58,0 +61,0 @@ 'node',

@@ -1,4 +0,4 @@

/// <reference types="node" />
import { Plugin, PluginEvents } from './types';
import { IRunEnvironment, IRunOptions } from '../api';
import { ILogger } from '../logger';
export declare class PluginManager {

@@ -10,5 +10,5 @@ private pluginFns;

private register;
init(logger: Console, configuration: IRunOptions, environment: IRunEnvironment): Promise<void>;
init(logger: ILogger, configuration: IRunOptions, environment: IRunEnvironment): Promise<void>;
emit<K extends keyof PluginEvents>(event: K, value: PluginEvents[K]): void;
cleanup(): Promise<void>;
}

@@ -1,4 +0,4 @@

/// <reference types="node" />
import { IRunEnvironment, IRunOptions } from '../api';
import { Envelope } from '@cucumber/messages';
import { ILogger } from '../logger';
export interface PluginEvents {

@@ -9,3 +9,3 @@ message: Envelope;

on: <K extends keyof PluginEvents>(event: K, handler: (value: PluginEvents[K]) => void) => void;
logger: Console;
logger: ILogger;
configuration: IRunOptions;

@@ -12,0 +12,0 @@ environment: IRunEnvironment;

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { ChildProcess } from 'child_process';

@@ -12,5 +11,6 @@ import * as messages from '@cucumber/messages';

import { IdGenerator } from '@cucumber/messages';
import { ILogger } from '../../logger';
export interface INewCoordinatorOptions {
cwd: string;
logger: Console;
logger: ILogger;
eventBroadcaster: EventEmitter;

@@ -17,0 +17,0 @@ eventDataCollector: EventDataCollector;

@@ -0,11 +1,22 @@

/// <reference types="node" />
/// <reference types="node" />
import { performance } from 'perf_hooks';
import * as messages from '@cucumber/messages';
import { FakeClock, GlobalTimers, TimerId } from '@sinonjs/fake-timers';
interface IMethods extends GlobalTimers<TimerId> {
interface ProtectedTimingBuiltins {
clearImmediate: typeof clearImmediate;
clearInterval: typeof clearInterval;
clearTimeout: typeof clearTimeout;
Date: typeof Date;
setImmediate: typeof setImmediate;
setInterval: typeof setInterval;
setTimeout: typeof setTimeout;
performance: typeof performance;
}
interface CustomTimingFunctions {
beginTiming: () => void;
endTiming: () => number;
performance: FakeClock<TimerId>['performance'];
}
declare const methods: Partial<IMethods>;
declare const methods: Partial<ProtectedTimingBuiltins & CustomTimingFunctions>;
export declare function durationBetweenTimestamps(startedTimestamp: messages.Timestamp, finishedTimestamp: messages.Timestamp): messages.Duration;
export declare function wrapPromiseWithTimeout<T>(promise: Promise<T>, timeoutInMilliseconds: number, timeoutMessage?: string): Promise<T>;
export default methods;

@@ -1,1 +0,1 @@

export declare const version = "8.5.3";
export declare const version = "8.6.0";

@@ -5,3 +5,3 @@ "use strict";

// Generated by genversion.
exports.version = '8.5.3';
exports.version = '8.6.0';
//# sourceMappingURL=version.js.map

@@ -11,3 +11,3 @@ {

],
"version": "8.5.3",
"version": "8.6.0",
"homepage": "https://github.com/cucumber/cucumber-js",

@@ -214,2 +214,3 @@ "author": "Julien Biezemans <jb@jbpros.com>",

"commander": "^9.0.0",
"debug": "^4.3.4",
"duration": "^0.2.2",

@@ -246,2 +247,3 @@ "durations": "^3.4.2",

"@types/chai": "4.3.3",
"@types/debug": "^4.1.7",
"@types/dirty-chai": "2.0.2",

@@ -248,0 +250,0 @@ "@types/express": "4.17.13",

@@ -102,2 +102,3 @@ <h1 align="center">

* Guides
* [Debugging](./docs/debugging.md)
* [Dry run](./docs/dry_run.md)

@@ -104,0 +105,0 @@ * [ES Modules](./docs/esm.md)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc