Skip to content

Commit 806fda1

Browse files
committed
refactor snippets
1 parent 24ffb18 commit 806fda1

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

javascript/src/SummaryPrinter.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,14 @@ export class SummaryPrinter {
111111
.flatMap((suggestion) => suggestion.snippets)
112112
.map((snippet) => snippet.code)
113113
const uniqueSnippets = new Set(snippets)
114-
if (snippets.length > 0) {
115-
this.println(formatSnippets(uniqueSnippets))
114+
if (uniqueSnippets.size > 0) {
115+
this.println()
116+
this.println('You can implement missing steps with the snippets below:')
117+
this.println()
118+
for (const snippet of uniqueSnippets) {
119+
this.println(snippet)
120+
this.println()
121+
}
116122
}
117123
}
118124
}

javascript/src/helpers.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
PickleTable,
1212
Rule,
1313
Scenario,
14-
Snippet,
1514
Step,
1615
StepDefinition,
1716
TestRunFinished,
@@ -95,6 +94,7 @@ export function formatPickleTags(pickle: Pickle, theme: Theme, stream: NodeJS.Wr
9594
.build(theme.tag)
9695
}
9796
}
97+
9898
export function formatPickleTitle(
9999
pickle: Pickle,
100100
scenario: Scenario,
@@ -377,10 +377,3 @@ export function formatCounts(
377377
}
378378
return builder.build()
379379
}
380-
381-
export function formatSnippets(snippets: Set<string>) {
382-
return `
383-
You can implement missing steps with the snippets below:
384-
385-
${[...snippets].join('\n\n')}`
386-
}

0 commit comments

Comments
 (0)