Skip to content

Commit 2785248

Browse files
Merge branch 'main' into update-migration-links-to-jsonschemas
2 parents abfff77 + c00274b commit 2785248

26 files changed

+288
-282
lines changed

features/fixtures/formatters/passed-rule.message.json.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ module.exports = [
22
{
33
source: {
44
uri: 'features/a.feature',
5-
data:
6-
'Feature: a feature\n Rule: a rule\n Example: an example\n Given a step',
5+
data: 'Feature: a feature\n Rule: a rule\n Example: an example\n Given a step',
76
mediaType: 'text/x.cucumber.gherkin+plain',
87
},
98
},

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,17 @@
226226
"@types/stream-buffers": "3.0.3",
227227
"@types/tmp": "0.2.0",
228228
"@types/verror": "1.10.4",
229-
"@typescript-eslint/eslint-plugin": "4.22.0",
230-
"@typescript-eslint/parser": "4.22.0",
229+
"@typescript-eslint/eslint-plugin": "4.26.0",
230+
"@typescript-eslint/parser": "4.26.0",
231231
"chai": "4.3.4",
232232
"chai-exclude": "2.0.3",
233233
"coffeescript": "2.5.1",
234234
"dependency-lint": "6.0.0",
235235
"dirty-chai": "2.0.1",
236-
"eslint": "7.25.0",
236+
"eslint": "7.27.0",
237237
"eslint-config-prettier": "8.3.0",
238238
"eslint-config-standard-with-typescript": "20.0.0",
239-
"eslint-plugin-import": "2.22.1",
239+
"eslint-plugin-import": "2.23.4",
240240
"eslint-plugin-node": "11.1.0",
241241
"eslint-plugin-prettier": "3.4.0",
242242
"eslint-plugin-promise": "5.1.0",
@@ -246,7 +246,7 @@
246246
"mocha": "8.4.0",
247247
"mustache": "4.2.0",
248248
"nyc": "15.1.0",
249-
"prettier": "2.2.1",
249+
"prettier": "2.3.0",
250250
"semver": "7.3.5",
251251
"sinon": "11.1.1",
252252
"sinon-chai": "3.7.0",

src/cli/configuration_builder_spec.ts

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ describe('Configuration', () => {
7676
const argv = baseArgv.concat([relativeFeaturePath])
7777

7878
// Act
79-
const {
80-
featurePaths,
81-
pickleFilterOptions,
82-
supportCodePaths,
83-
} = await ConfigurationBuilder.build({ argv, cwd })
79+
const { featurePaths, pickleFilterOptions, supportCodePaths } =
80+
await ConfigurationBuilder.build({ argv, cwd })
8481

8582
// Assert
8683
expect(featurePaths).to.eql([featurePath])
@@ -99,11 +96,8 @@ describe('Configuration', () => {
9996
const argv = baseArgv.concat([relativeFeaturePath])
10097

10198
// Act
102-
const {
103-
featurePaths,
104-
pickleFilterOptions,
105-
supportCodePaths,
106-
} = await ConfigurationBuilder.build({ argv, cwd })
99+
const { featurePaths, pickleFilterOptions, supportCodePaths } =
100+
await ConfigurationBuilder.build({ argv, cwd })
107101

108102
// Assert
109103
expect(featurePaths).to.eql([featurePath])
@@ -124,11 +118,8 @@ describe('Configuration', () => {
124118
const argv = baseArgv.concat([relativeFeaturePath])
125119

126120
// Act
127-
const {
128-
featurePaths,
129-
pickleFilterOptions,
130-
supportCodePaths,
131-
} = await ConfigurationBuilder.build({ argv, cwd })
121+
const { featurePaths, pickleFilterOptions, supportCodePaths } =
122+
await ConfigurationBuilder.build({ argv, cwd })
132123

133124
// Assert
134125
expect(featurePaths).to.eql([featurePath])
@@ -151,11 +142,8 @@ describe('Configuration', () => {
151142
const argv = baseArgv.concat([relativeFeaturePath])
152143

153144
// Act
154-
const {
155-
featurePaths,
156-
pickleFilterOptions,
157-
supportCodePaths,
158-
} = await ConfigurationBuilder.build({ argv, cwd })
145+
const { featurePaths, pickleFilterOptions, supportCodePaths } =
146+
await ConfigurationBuilder.build({ argv, cwd })
159147

160148
// Assert
161149
expect(featurePaths).to.eql([featurePath])
@@ -175,11 +163,8 @@ describe('Configuration', () => {
175163
const argv = baseArgv.concat([relativeRerunPath])
176164

177165
// Act
178-
const {
179-
featurePaths,
180-
pickleFilterOptions,
181-
supportCodePaths,
182-
} = await ConfigurationBuilder.build({ argv, cwd })
166+
const { featurePaths, pickleFilterOptions, supportCodePaths } =
167+
await ConfigurationBuilder.build({ argv, cwd })
183168

184169
// Assert
185170
expect(featurePaths).to.eql([])
@@ -199,11 +184,8 @@ describe('Configuration', () => {
199184
const argv = baseArgv.concat([relativeRerunPath])
200185

201186
// Act
202-
const {
203-
featurePaths,
204-
pickleFilterOptions,
205-
supportCodePaths,
206-
} = await ConfigurationBuilder.build({ argv, cwd })
187+
const { featurePaths, pickleFilterOptions, supportCodePaths } =
188+
await ConfigurationBuilder.build({ argv, cwd })
207189

208190
// Assert
209191
expect(featurePaths).to.eql([])
@@ -223,11 +205,8 @@ describe('Configuration', () => {
223205
const argv = baseArgv.concat([relativeRerunPath])
224206

225207
// Act
226-
const {
227-
featurePaths,
228-
pickleFilterOptions,
229-
supportCodePaths,
230-
} = await ConfigurationBuilder.build({ argv, cwd })
208+
const { featurePaths, pickleFilterOptions, supportCodePaths } =
209+
await ConfigurationBuilder.build({ argv, cwd })
231210

232211
// Assert
233212
expect(featurePaths).to.eql([])

src/cli/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ export default class Cli {
133133
supportCodeLibrary,
134134
}
135135
if (doesNotHaveValue(formatOptions.colorsEnabled)) {
136-
typeOptions.parsedArgvOptions.colorsEnabled = (stream as TtyWriteStream).isTTY
136+
typeOptions.parsedArgvOptions.colorsEnabled = (
137+
stream as TtyWriteStream
138+
).isTTY
137139
}
138140
if (type === 'progress-bar' && !(stream as TtyWriteStream).isTTY) {
139141
const outputToName = outputTo === '' ? 'stdout' : outputTo

src/formatter/helpers/event_data_collector.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,15 @@ export default class EventDataCollector {
113113
testStepId,
114114
testStepResult,
115115
}: messages.TestStepFinished): void {
116-
this.testCaseAttemptDataMap[testCaseStartedId].stepResults[
117-
testStepId
118-
] = testStepResult
116+
this.testCaseAttemptDataMap[testCaseStartedId].stepResults[testStepId] =
117+
testStepResult
119118
}
120119

121120
storeTestCaseResult({ testCaseStartedId }: messages.TestCaseFinished): void {
122121
const stepResults = values(
123122
this.testCaseAttemptDataMap[testCaseStartedId].stepResults
124123
)
125-
this.testCaseAttemptDataMap[
126-
testCaseStartedId
127-
].worstTestStepResult = messages.getWorstTestStepResult(stepResults)
124+
this.testCaseAttemptDataMap[testCaseStartedId].worstTestStepResult =
125+
messages.getWorstTestStepResult(stepResults)
128126
}
129127
}

src/formatter/helpers/gherkin_document_parser.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ export function getGherkinScenarioLocationMap(
6868
gherkinDocument: messages.GherkinDocument
6969
): Record<string, messages.Location> {
7070
const locationMap: Record<string, messages.Location> = {}
71-
const scenarioMap: Record<string, messages.Scenario> = getGherkinScenarioMap(
72-
gherkinDocument
73-
)
71+
const scenarioMap: Record<string, messages.Scenario> =
72+
getGherkinScenarioMap(gherkinDocument)
7473
_.entries<messages.Scenario>(scenarioMap).forEach(([id, scenario]) => {
7574
locationMap[id] = scenario.location
7675
if (doesHaveValue(scenario.examples)) {

src/formatter/helpers/gherkin_document_parser_spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ describe('GherkinDocumentParser', () => {
7878

7979
it('works for a Background and Rule with its own Background and Examples', async () => {
8080
// Arrange
81-
const gherkinDocument = await withBackgroundAndRuleWithBackgroundAndExamples()
81+
const gherkinDocument =
82+
await withBackgroundAndRuleWithBackgroundAndExamples()
8283

8384
// Act
8485
const output = getGherkinStepMap(gherkinDocument)
@@ -156,7 +157,8 @@ describe('GherkinDocumentParser', () => {
156157

157158
it('works for a Background and Rule with its own Background and Examples', async () => {
158159
// Arrange
159-
const gherkinDocument = await withBackgroundAndRuleWithBackgroundAndExamples()
160+
const gherkinDocument =
161+
await withBackgroundAndRuleWithBackgroundAndExamples()
160162

161163
// Act
162164
const output = getGherkinScenarioMap(gherkinDocument)
@@ -215,7 +217,8 @@ describe('GherkinDocumentParser', () => {
215217

216218
it('works for a Background and Rule with its own Background and Examples', async () => {
217219
// Arrange
218-
const gherkinDocument = await withBackgroundAndRuleWithBackgroundAndExamples()
220+
const gherkinDocument =
221+
await withBackgroundAndRuleWithBackgroundAndExamples()
219222

220223
// Act
221224
const output = await getGherkinExampleRuleMap(gherkinDocument)
@@ -284,7 +287,8 @@ describe('GherkinDocumentParser', () => {
284287

285288
it('works for a Background and Rule with its own Background and Examples', async () => {
286289
// Arrange
287-
const gherkinDocument = await withBackgroundAndRuleWithBackgroundAndExamples()
290+
const gherkinDocument =
291+
await withBackgroundAndRuleWithBackgroundAndExamples()
288292

289293
// Act
290294
const output = await getGherkinScenarioLocationMap(gherkinDocument)

src/formatter/helpers/pickle_parser.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ export function getPickleLocation({
5252
gherkinDocument,
5353
pickle,
5454
}: IGetPickleLocationRequest): messages.Location {
55-
const gherkinScenarioLocationMap = getGherkinScenarioLocationMap(
56-
gherkinDocument
57-
)
55+
const gherkinScenarioLocationMap =
56+
getGherkinScenarioLocationMap(gherkinDocument)
5857
return gherkinScenarioLocationMap[_.last(pickle.astNodeIds)]
5958
}

src/formatter/helpers/test_case_attempt_parser.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ export function parseTestCaseAttempt({
133133
}: IParseTestCaseAttemptRequest): IParsedTestCaseAttempt {
134134
const { testCase, pickle, gherkinDocument } = testCaseAttempt
135135
const gherkinStepMap = getGherkinStepMap(gherkinDocument)
136-
const gherkinScenarioLocationMap = getGherkinScenarioLocationMap(
137-
gherkinDocument
138-
)
136+
const gherkinScenarioLocationMap =
137+
getGherkinScenarioLocationMap(gherkinDocument)
139138
const pickleStepMap = getPickleStepMap(pickle)
140139
const relativePickleUri = pickle.uri
141140
const parsedTestCase: IParsedTestCase = {

src/formatter/helpers/usage_helpers/index_spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ describe('Usage Helpers', () => {
1616
const supportCodeLibrary = buildSupportCodeLibrary(({ Given }) => {
1717
Given('a step', code)
1818
})
19-
const {
20-
eventDataCollector,
21-
} = await getEnvelopesAndEventDataCollector({ supportCodeLibrary })
19+
const { eventDataCollector } =
20+
await getEnvelopesAndEventDataCollector({ supportCodeLibrary })
2221

2322
// Act
2423
const output = getUsage({
@@ -53,9 +52,8 @@ describe('Usage Helpers', () => {
5352
)
5453
}
5554
)
56-
const {
57-
eventDataCollector,
58-
} = await getEnvelopesAndEventDataCollector({ supportCodeLibrary })
55+
const { eventDataCollector } =
56+
await getEnvelopesAndEventDataCollector({ supportCodeLibrary })
5957

6058
// Act
6159
const output = getUsage({

0 commit comments

Comments
 (0)