@cucumber/cucumber 8.9.0 → 8.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/support.js +5 -1
- package/lib/api/support.js.map +1 -1
- package/lib/api/test_helpers.d.ts +3 -0
- package/lib/api/test_helpers.js +33 -0
- package/lib/api/test_helpers.js.map +1 -0
- package/lib/api/types.d.ts +1 -1
- package/lib/cli/validate_node_engine_version.d.ts +1 -1
- package/lib/formatter/get_color_fns.d.ts +1 -1
- package/lib/formatter/index.d.ts +3 -3
- package/lib/models/gherkin_step_keyword.d.ts +1 -1
- package/lib/models/pickle_order.d.ts +1 -1
- package/lib/plugin/types.d.ts +2 -2
- package/lib/publish/http_stream.d.ts +1 -1
- package/lib/runtime/attachment_manager/index.d.ts +3 -3
- package/lib/runtime/parallel/worker.d.ts +2 -2
- package/lib/runtime/parallel/worker.js +5 -1
- package/lib/runtime/parallel/worker.js.map +1 -1
- package/lib/runtime/run_test_run_hooks.d.ts +1 -1
- package/lib/support_code_library_builder/types.d.ts +6 -6
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +22 -22
package/lib/api/support.js
CHANGED
|
@@ -9,7 +9,11 @@ const url_1 = require("url");
|
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
10
10
|
const { importer } = require('../importer');
|
|
11
11
|
async function getSupportCodeLibrary({ cwd, newId, requireModules, requirePaths, importPaths, }) {
|
|
12
|
-
support_code_library_builder_1.default.reset(cwd, newId
|
|
12
|
+
support_code_library_builder_1.default.reset(cwd, newId, {
|
|
13
|
+
requireModules,
|
|
14
|
+
requirePaths,
|
|
15
|
+
importPaths,
|
|
16
|
+
});
|
|
13
17
|
requireModules.map((module) => require(module));
|
|
14
18
|
requirePaths.map((path) => require(path));
|
|
15
19
|
for (const path of importPaths) {
|
package/lib/api/support.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/api/support.ts"],"names":[],"mappings":";;;;;;AAEA,mGAAuE;AACvE,6BAAmC;AAEnC,8DAA8D;AAC9D,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AAEpC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,GAAG,EACH,KAAK,EACL,cAAc,EACd,YAAY,EACZ,WAAW,GAOZ;IACC,sCAAyB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/api/support.ts"],"names":[],"mappings":";;;;;;AAEA,mGAAuE;AACvE,6BAAmC;AAEnC,8DAA8D;AAC9D,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AAEpC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,GAAG,EACH,KAAK,EACL,cAAc,EACd,YAAY,EACZ,WAAW,GAOZ;IACC,sCAAyB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE;QAC1C,cAAc;QACd,YAAY;QACZ,WAAW;KACZ,CAAC,CAAA;IACF,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IAC/C,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IACzC,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE;QAC9B,MAAM,QAAQ,CAAC,IAAA,mBAAa,EAAC,IAAI,CAAC,CAAC,CAAA;KACpC;IACD,OAAO,sCAAyB,CAAC,QAAQ,EAAE,CAAA;AAC7C,CAAC;AAxBD,sDAwBC","sourcesContent":["import { IdGenerator } from '@cucumber/messages'\nimport { ISupportCodeLibrary } from '../support_code_library_builder/types'\nimport supportCodeLibraryBuilder from '../support_code_library_builder'\nimport { pathToFileURL } from 'url'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst { importer } = require('../importer')\n\nexport async function getSupportCodeLibrary({\n cwd,\n newId,\n requireModules,\n requirePaths,\n importPaths,\n}: {\n cwd: string\n newId: IdGenerator.NewId\n requireModules: string[]\n requirePaths: string[]\n importPaths: string[]\n}): Promise<ISupportCodeLibrary> {\n supportCodeLibraryBuilder.reset(cwd, newId, {\n requireModules,\n requirePaths,\n importPaths,\n })\n requireModules.map((module) => require(module))\n requirePaths.map((path) => require(path))\n for (const path of importPaths) {\n await importer(pathToFileURL(path))\n }\n return supportCodeLibraryBuilder.finalize()\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.teardownEnvironment = exports.setupEnvironment = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_1 = __importDefault(require("mz/fs"));
|
|
9
|
+
const reindent_template_literals_1 = require("reindent-template-literals");
|
|
10
|
+
const stream_1 = require("stream");
|
|
11
|
+
const messages_1 = require("@cucumber/messages");
|
|
12
|
+
const newId = messages_1.IdGenerator.uuid();
|
|
13
|
+
async function setupEnvironment() {
|
|
14
|
+
const cwd = path_1.default.join(__dirname, '..', '..', 'tmp', `api_${newId()}`);
|
|
15
|
+
await fs_1.default.mkdir(path_1.default.join(cwd, 'features'), { recursive: true });
|
|
16
|
+
await fs_1.default.writeFile(path_1.default.join(cwd, 'features', 'test.feature'), (0, reindent_template_literals_1.reindent)(`Feature: test fixture
|
|
17
|
+
Scenario: one
|
|
18
|
+
Given a step
|
|
19
|
+
Then another step`));
|
|
20
|
+
await fs_1.default.writeFile(path_1.default.join(cwd, 'features', 'steps.ts'), (0, reindent_template_literals_1.reindent)(`import { Given, Then } from '../../../src'
|
|
21
|
+
Given('a step', function () {})
|
|
22
|
+
Then('another step', function () {})`));
|
|
23
|
+
await fs_1.default.writeFile(path_1.default.join(cwd, 'cucumber.mjs'), `export default {paths: ['features/test.feature'], requireModule: ['ts-node/register'], require: ['features/steps.ts']}`);
|
|
24
|
+
const stdout = new stream_1.PassThrough();
|
|
25
|
+
return { cwd, stdout };
|
|
26
|
+
}
|
|
27
|
+
exports.setupEnvironment = setupEnvironment;
|
|
28
|
+
async function teardownEnvironment(environment) {
|
|
29
|
+
await fs_1.default.rmdir(environment.cwd, { recursive: true });
|
|
30
|
+
environment.stdout.end();
|
|
31
|
+
}
|
|
32
|
+
exports.teardownEnvironment = teardownEnvironment;
|
|
33
|
+
//# sourceMappingURL=test_helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test_helpers.js","sourceRoot":"","sources":["../../src/api/test_helpers.ts"],"names":[],"mappings":";;;;;;AACA,gDAAuB;AACvB,+CAAsB;AACtB,2EAAqD;AACrD,mCAAoC;AACpC,iDAAgD;AAEhD,MAAM,KAAK,GAAG,sBAAW,CAAC,IAAI,EAAE,CAAA;AAEzB,KAAK,UAAU,gBAAgB;IACpC,MAAM,GAAG,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,KAAK,EAAE,EAAE,CAAC,CAAA;IACrE,MAAM,YAAE,CAAC,KAAK,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC/D,MAAM,YAAE,CAAC,SAAS,CAChB,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,cAAc,CAAC,EAC1C,IAAA,qCAAQ,EAAC;;;0BAGa,CAAC,CACxB,CAAA;IACD,MAAM,YAAE,CAAC,SAAS,CAChB,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EACtC,IAAA,qCAAQ,EAAC;;yCAE4B,CAAC,CACvC,CAAA;IACD,MAAM,YAAE,CAAC,SAAS,CAChB,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,EAC9B,wHAAwH,CACzH,CAAA;IACD,MAAM,MAAM,GAAG,IAAI,oBAAW,EAAE,CAAA;IAChC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA;AACxB,CAAC;AAtBD,4CAsBC;AAEM,KAAK,UAAU,mBAAmB,CAAC,WAA4B;IACpE,MAAM,YAAE,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACpD,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,CAAA;AAC1B,CAAC;AAHD,kDAGC","sourcesContent":["import { IRunEnvironment } from './types'\nimport path from 'path'\nimport fs from 'mz/fs'\nimport { reindent } from 'reindent-template-literals'\nimport { PassThrough } from 'stream'\nimport { IdGenerator } from '@cucumber/messages'\n\nconst newId = IdGenerator.uuid()\n\nexport async function setupEnvironment(): Promise<Partial<IRunEnvironment>> {\n const cwd = path.join(__dirname, '..', '..', 'tmp', `api_${newId()}`)\n await fs.mkdir(path.join(cwd, 'features'), { recursive: true })\n await fs.writeFile(\n path.join(cwd, 'features', 'test.feature'),\n reindent(`Feature: test fixture\n Scenario: one\n Given a step\n Then another step`)\n )\n await fs.writeFile(\n path.join(cwd, 'features', 'steps.ts'),\n reindent(`import { Given, Then } from '../../../src'\n Given('a step', function () {})\n Then('another step', function () {})`)\n )\n await fs.writeFile(\n path.join(cwd, 'cucumber.mjs'),\n `export default {paths: ['features/test.feature'], requireModule: ['ts-node/register'], require: ['features/steps.ts']}`\n )\n const stdout = new PassThrough()\n return { cwd, stdout }\n}\n\nexport async function teardownEnvironment(environment: IRunEnvironment) {\n await fs.rmdir(environment.cwd, { recursive: true })\n environment.stdout.end()\n}\n"]}
|
package/lib/api/types.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ export interface IRunConfiguration {
|
|
|
117
117
|
/**
|
|
118
118
|
* @public
|
|
119
119
|
*/
|
|
120
|
-
export
|
|
120
|
+
export type ISupportCodeCoordinatesOrLibrary = ISupportCodeCoordinates | ISupportCodeLibrary;
|
|
121
121
|
/**
|
|
122
122
|
* @public
|
|
123
123
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { TestStepResultStatus } from '@cucumber/messages';
|
|
4
4
|
import { Writable } from 'stream';
|
|
5
|
-
export
|
|
5
|
+
export type IColorFn = (text: string) => string;
|
|
6
6
|
export interface IColorFns {
|
|
7
7
|
forStatus: (status: TestStepResultStatus) => IColorFn;
|
|
8
8
|
location: IColorFn;
|
package/lib/formatter/index.d.ts
CHANGED
|
@@ -22,9 +22,9 @@ export interface IPublishConfig {
|
|
|
22
22
|
url: string;
|
|
23
23
|
token: string;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
25
|
+
export type IFormatterStream = Writable;
|
|
26
|
+
export type IFormatterLogFn = (buffer: string | Uint8Array) => void;
|
|
27
|
+
export type IFormatterCleanupFn = () => Promise<any>;
|
|
28
28
|
export interface IFormatterOptions {
|
|
29
29
|
colorFns: IColorFns;
|
|
30
30
|
cwd: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type GherkinStepKeyword = 'Unknown' | 'Given' | 'When' | 'Then';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type PickleOrder = 'defined' | 'random' | string;
|
package/lib/plugin/types.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export interface PluginContext {
|
|
|
10
10
|
configuration: IRunOptions;
|
|
11
11
|
environment: IRunEnvironment;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type PluginCleanup = () => any | void | Promise<any | void>;
|
|
14
|
+
export type Plugin = (context: PluginContext) => Promise<PluginCleanup | void>;
|
|
@@ -10,9 +10,9 @@ export interface IAttachment {
|
|
|
10
10
|
data: string;
|
|
11
11
|
media: IAttachmentMedia;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
13
|
+
export type IAttachFunction = (attachment: IAttachment) => void;
|
|
14
|
+
export type ICreateAttachment = (data: Buffer | Readable | string, mediaType?: string, callback?: () => void) => void | Promise<void>;
|
|
15
|
+
export type ICreateLog = (text: string) => void | Promise<void>;
|
|
16
16
|
export default class AttachmentManager {
|
|
17
17
|
private readonly onAttachment;
|
|
18
18
|
constructor(onAttachment: IAttachFunction);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ICoordinatorReport, IWorkerCommand, IWorkerCommandInitialize, IWorkerCommandRun } from './command_types';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type IExitFunction = (exitCode: number, error?: Error, message?: string) => void;
|
|
3
|
+
type IMessageSender = (command: ICoordinatorReport) => void;
|
|
4
4
|
export default class Worker {
|
|
5
5
|
private readonly cwd;
|
|
6
6
|
private readonly exit;
|
|
@@ -32,7 +32,11 @@ class Worker {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
async initialize({ filterStacktraces, requireModules, requirePaths, importPaths, supportCodeIds, options, }) {
|
|
35
|
-
support_code_library_builder_1.default.reset(this.cwd, this.newId
|
|
35
|
+
support_code_library_builder_1.default.reset(this.cwd, this.newId, {
|
|
36
|
+
requireModules,
|
|
37
|
+
requirePaths,
|
|
38
|
+
importPaths,
|
|
39
|
+
});
|
|
36
40
|
requireModules.map((module) => require(module));
|
|
37
41
|
requirePaths.map((module) => require(module));
|
|
38
42
|
for (const path of importPaths) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/runtime/parallel/worker.ts"],"names":[],"mappings":";;;;;AAC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U,CAAC,CAAA;SAC1C;aAAM,IAAI,OAAO,CAAC,QAAQ,EAAE;YAC3B,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;SACtB;aAAM,IAAI,IAAA,6BAAa,EAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACrC,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;SACpC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EAChB,eAAe,EACf,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,GACc;QAClB,MAAM,SAAS,GAAG,IAAI,gCAAoB,EAAE,CAAA;QAC5C,SAAS,CAAC,IAAI,CAAC,IAAA,oBAAQ,EAAC,OAAO,CAAC,CAAC,CAAA;QACjC,MAAM,cAAc,GAAG,IAAI,0BAAc,CAAC;YACxC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,SAAS;YACT,eAAe;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM;YACN,QAAQ;YACR,OAAO;YACP,IAAI;YACJ,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAC,CAAA;QACF,MAAM,cAAc,CAAC,GAAG,EAAE,CAAA;QAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACnC,CAAC;CACF;AAtHD,yBAsHC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { IdGenerator } from '@cucumber/messages'\nimport { duration } from 'durations'\nimport { EventEmitter } from 'events'\nimport { pathToFileURL } from 'url'\nimport supportCodeLibraryBuilder from '../../support_code_library_builder'\nimport { ISupportCodeLibrary } from '../../support_code_library_builder/types'\nimport { doesHaveValue } from '../../value_checker'\nimport { makeRunTestRunHooks, RunsTestRunHooks } from '../run_test_run_hooks'\nimport { RealTestRunStopwatch } from '../stopwatch'\nimport TestCaseRunner from '../test_case_runner'\nimport {\n ICoordinatorReport,\n IWorkerCommand,\n IWorkerCommandInitialize,\n IWorkerCommandRun,\n} from './command_types'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst { importer } = require('../../importer')\nconst { uuid } = IdGenerator\n\ntype IExitFunction = (exitCode: number, error?: Error, message?: string) => void\ntype IMessageSender = (command: ICoordinatorReport) => void\n\nexport default class Worker {\n private readonly cwd: string\n private readonly exit: IExitFunction\n\n private readonly id: string\n private readonly eventBroadcaster: EventEmitter\n private filterStacktraces: boolean\n private readonly newId: IdGenerator.NewId\n private readonly sendMessage: IMessageSender\n private supportCodeLibrary: ISupportCodeLibrary\n private worldParameters: any\n private runTestRunHooks: RunsTestRunHooks\n\n constructor({\n cwd,\n exit,\n id,\n sendMessage,\n }: {\n cwd: string\n exit: IExitFunction\n id: string\n sendMessage: IMessageSender\n }) {\n this.id = id\n this.newId = uuid()\n this.cwd = cwd\n this.exit = exit\n this.sendMessage = sendMessage\n this.eventBroadcaster = new EventEmitter()\n this.eventBroadcaster.on('envelope', (envelope: messages.Envelope) => {\n // assign `workerId` property only for the `testCaseStarted` message\n if (envelope.testCaseStarted) {\n envelope.testCaseStarted.workerId = this.id\n }\n this.sendMessage({ jsonEnvelope: JSON.stringify(envelope) })\n })\n }\n\n async initialize({\n filterStacktraces,\n requireModules,\n requirePaths,\n importPaths,\n supportCodeIds,\n options,\n }: IWorkerCommandInitialize): Promise<void> {\n supportCodeLibraryBuilder.reset(this.cwd, this.newId, {\n requireModules,\n requirePaths,\n importPaths,\n })\n requireModules.map((module) => require(module))\n requirePaths.map((module) => require(module))\n for (const path of importPaths) {\n await importer(pathToFileURL(path))\n }\n this.supportCodeLibrary = supportCodeLibraryBuilder.finalize(supportCodeIds)\n\n this.worldParameters = options.worldParameters\n this.filterStacktraces = filterStacktraces\n this.runTestRunHooks = makeRunTestRunHooks(\n options.dryRun,\n this.supportCodeLibrary.defaultTimeout,\n (name, location) =>\n `${name} hook errored on worker ${this.id}, process exiting: ${location}`\n )\n await this.runTestRunHooks(\n this.supportCodeLibrary.beforeTestRunHookDefinitions,\n 'a BeforeAll'\n )\n this.sendMessage({ ready: true })\n }\n\n async finalize(): Promise<void> {\n await this.runTestRunHooks(\n this.supportCodeLibrary.afterTestRunHookDefinitions,\n 'an AfterAll'\n )\n this.exit(0)\n }\n\n async receiveMessage(message: IWorkerCommand): Promise<void> {\n if (doesHaveValue(message.initialize)) {\n await this.initialize(message.initialize)\n } else if (message.finalize) {\n await this.finalize()\n } else if (doesHaveValue(message.run)) {\n await this.runTestCase(message.run)\n }\n }\n\n async runTestCase({\n gherkinDocument,\n pickle,\n testCase,\n elapsed,\n retries,\n skip,\n }: IWorkerCommandRun): Promise<void> {\n const stopwatch = new RealTestRunStopwatch()\n stopwatch.from(duration(elapsed))\n const testCaseRunner = new TestCaseRunner({\n eventBroadcaster: this.eventBroadcaster,\n stopwatch,\n gherkinDocument,\n newId: this.newId,\n pickle,\n testCase,\n retries,\n skip,\n filterStackTraces: this.filterStacktraces,\n supportCodeLibrary: this.supportCodeLibrary,\n worldParameters: this.worldParameters,\n })\n await testCaseRunner.run()\n this.sendMessage({ ready: true })\n }\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import TestRunHookDefinition from '../models/test_run_hook_definition';
|
|
2
|
-
export
|
|
2
|
+
export type RunsTestRunHooks = (definitions: TestRunHookDefinition[], name: string) => Promise<void>;
|
|
3
3
|
export declare const makeRunTestRunHooks: (dryRun: boolean, defaultTimeout: number, errorMessage: (name: string, location: string) => string) => RunsTestRunHooks;
|
|
@@ -5,8 +5,8 @@ import TestRunHookDefinition from '../models/test_run_hook_definition';
|
|
|
5
5
|
import StepDefinition from '../models/step_definition';
|
|
6
6
|
import { ParameterTypeRegistry } from '@cucumber/cucumber-expressions';
|
|
7
7
|
import { IWorld } from './world';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type DefineStepPattern = string | RegExp;
|
|
9
|
+
export type ParallelAssignmentValidator = (pickle: messages.Pickle, runningPickles: messages.Pickle[]) => boolean;
|
|
10
10
|
export interface ITestCaseHookParameter {
|
|
11
11
|
gherkinDocument: messages.GherkinDocument;
|
|
12
12
|
pickle: messages.Pickle;
|
|
@@ -22,9 +22,9 @@ export interface ITestStepHookParameter {
|
|
|
22
22
|
testCaseStartedId: string;
|
|
23
23
|
testStepId: string;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
25
|
+
export type TestCaseHookFunction<WorldType> = (this: WorldType, arg: ITestCaseHookParameter) => any | Promise<any>;
|
|
26
|
+
export type TestStepHookFunction<WorldType> = (this: WorldType, arg: ITestStepHookParameter) => any | Promise<any>;
|
|
27
|
+
export type TestStepFunction<WorldType> = (this: WorldType, ...args: any[]) => any | Promise<any>;
|
|
28
28
|
export interface IDefineStepOptions {
|
|
29
29
|
timeout?: number;
|
|
30
30
|
wrapperOptions?: any;
|
|
@@ -48,7 +48,7 @@ export interface IParameterTypeDefinition<T> {
|
|
|
48
48
|
useForSnippets?: boolean;
|
|
49
49
|
preferForRegexpMatch?: boolean;
|
|
50
50
|
}
|
|
51
|
-
export
|
|
51
|
+
export type IDefineStep = (<WorldType = IWorld>(pattern: DefineStepPattern, code: TestStepFunction<WorldType>) => void) & (<WorldType = IWorld>(pattern: DefineStepPattern, options: IDefineStepOptions, code: TestStepFunction<WorldType>) => void);
|
|
52
52
|
export interface IDefineSupportCodeMethods {
|
|
53
53
|
defineParameterType: (options: IParameterTypeDefinition<any>) => void;
|
|
54
54
|
defineStep: IDefineStep;
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "8.9.
|
|
1
|
+
export declare const version = "8.9.1";
|
package/lib/version.js
CHANGED
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,OAAO,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '8.9.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,OAAO,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '8.9.1'\n"]}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"gherkin",
|
|
9
9
|
"tests"
|
|
10
10
|
],
|
|
11
|
-
"version": "8.9.
|
|
11
|
+
"version": "8.9.1",
|
|
12
12
|
"homepage": "https://github.com/cucumber/cucumber-js",
|
|
13
13
|
"author": "Julien Biezemans <jb@jbpros.com>",
|
|
14
14
|
"contributors": [
|
|
@@ -197,11 +197,11 @@
|
|
|
197
197
|
},
|
|
198
198
|
"dependencies": {
|
|
199
199
|
"@cucumber/ci-environment": "9.1.0",
|
|
200
|
-
"@cucumber/cucumber-expressions": "16.
|
|
201
|
-
"@cucumber/gherkin": "
|
|
200
|
+
"@cucumber/cucumber-expressions": "16.1.0",
|
|
201
|
+
"@cucumber/gherkin": "25.0.2",
|
|
202
202
|
"@cucumber/gherkin-streams": "5.0.1",
|
|
203
|
-
"@cucumber/gherkin-utils": "8.0.
|
|
204
|
-
"@cucumber/html-formatter": "20.
|
|
203
|
+
"@cucumber/gherkin-utils": "8.0.2",
|
|
204
|
+
"@cucumber/html-formatter": "20.2.0",
|
|
205
205
|
"@cucumber/message-streams": "4.0.1",
|
|
206
206
|
"@cucumber/messages": "20.0.0",
|
|
207
207
|
"@cucumber/tag-expressions": "4.1.0",
|
|
@@ -238,11 +238,11 @@
|
|
|
238
238
|
},
|
|
239
239
|
"devDependencies": {
|
|
240
240
|
"@cucumber/compatibility-kit": "11.0.1",
|
|
241
|
-
"@cucumber/query": "12.0.
|
|
242
|
-
"@microsoft/api-documenter": "7.19.
|
|
243
|
-
"@microsoft/api-extractor": "7.33.
|
|
244
|
-
"@sinonjs/fake-timers": "
|
|
245
|
-
"@types/chai": "4.3.
|
|
241
|
+
"@cucumber/query": "12.0.1",
|
|
242
|
+
"@microsoft/api-documenter": "7.19.25",
|
|
243
|
+
"@microsoft/api-extractor": "7.33.6",
|
|
244
|
+
"@sinonjs/fake-timers": "10.0.0",
|
|
245
|
+
"@types/chai": "4.3.4",
|
|
246
246
|
"@types/chai-xml": "^0.3.2",
|
|
247
247
|
"@types/debug": "4.1.7",
|
|
248
248
|
"@types/dirty-chai": "2.0.2",
|
|
@@ -252,26 +252,26 @@
|
|
|
252
252
|
"@types/has-ansi": "5.0.0",
|
|
253
253
|
"@types/lodash.merge": "4.6.7",
|
|
254
254
|
"@types/lodash.mergewith": "4.6.7",
|
|
255
|
-
"@types/mocha": "10.0.
|
|
256
|
-
"@types/mustache": "4.2.
|
|
255
|
+
"@types/mocha": "10.0.1",
|
|
256
|
+
"@types/mustache": "4.2.2",
|
|
257
257
|
"@types/mz": "2.7.4",
|
|
258
|
-
"@types/node": "18.11.
|
|
258
|
+
"@types/node": "18.11.10",
|
|
259
259
|
"@types/progress": "2.0.5",
|
|
260
260
|
"@types/semver": "7.3.13",
|
|
261
|
-
"@types/sinon-chai": "3.2.
|
|
261
|
+
"@types/sinon-chai": "3.2.9",
|
|
262
262
|
"@types/sinonjs__fake-timers": "8.1.2",
|
|
263
263
|
"@types/stream-buffers": "3.0.4",
|
|
264
264
|
"@types/tmp": "0.2.3",
|
|
265
265
|
"@types/verror": "1.10.6",
|
|
266
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
267
|
-
"@typescript-eslint/parser": "5.
|
|
268
|
-
"chai": "4.3.
|
|
266
|
+
"@typescript-eslint/eslint-plugin": "5.45.0",
|
|
267
|
+
"@typescript-eslint/parser": "5.45.0",
|
|
268
|
+
"chai": "4.3.7",
|
|
269
269
|
"chai-exclude": "2.1.0",
|
|
270
270
|
"chai-xml": "^0.4.0",
|
|
271
271
|
"coffeescript": "2.7.0",
|
|
272
272
|
"dependency-lint": "7.1.0",
|
|
273
273
|
"dirty-chai": "2.0.1",
|
|
274
|
-
"eslint": "8.
|
|
274
|
+
"eslint": "8.28.0",
|
|
275
275
|
"eslint-config-prettier": "8.5.0",
|
|
276
276
|
"eslint-plugin-import": "2.26.0",
|
|
277
277
|
"eslint-plugin-node": "11.1.0",
|
|
@@ -283,16 +283,16 @@
|
|
|
283
283
|
"mocha": "10.1.0",
|
|
284
284
|
"mustache": "4.2.0",
|
|
285
285
|
"nyc": "15.1.0",
|
|
286
|
-
"prettier": "2.
|
|
286
|
+
"prettier": "2.8.0",
|
|
287
287
|
"reindent-template-literals": "1.1.0",
|
|
288
288
|
"shx": "0.3.4",
|
|
289
|
-
"sinon": "
|
|
289
|
+
"sinon": "15.0.0",
|
|
290
290
|
"sinon-chai": "3.7.0",
|
|
291
291
|
"stream-buffers": "3.0.2",
|
|
292
292
|
"stream-to-string": "1.2.0",
|
|
293
293
|
"ts-node": "10.9.1",
|
|
294
|
-
"tsd": "0.
|
|
295
|
-
"typescript": "4.
|
|
294
|
+
"tsd": "0.25.0",
|
|
295
|
+
"typescript": "4.9.3"
|
|
296
296
|
},
|
|
297
297
|
"overrides": {
|
|
298
298
|
"ansi-regex": "^5.0.1"
|