Skip to content

Commit 334f74a

Browse files
woodieonsi
authored andcommitted
respect SilenceSkips in fd mode, add test
1 parent 21047ce commit 334f74a

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

reporters/default_reporter.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,6 @@ func (r *DefaultReporter) wrapTextBlock(sectionName string, fn func()) {
222222
}
223223

224224
func (r *DefaultReporter) DidRun(report types.SpecReport) {
225-
if r.conf.FdOutput {
226-
r.didRunFd(report)
227-
return
228-
}
229225
v := r.conf.Verbosity()
230226
inParallel := report.RunningInParallel
231227

@@ -234,6 +230,10 @@ func (r *DefaultReporter) DidRun(report types.SpecReport) {
234230
return
235231
}
236232

233+
if r.conf.FdOutput {
234+
r.didRunFd(report)
235+
return
236+
}
237237
header := r.specDenoter
238238
if report.LeafNodeType.Is(types.NodeTypesForSuiteLevelNodes) {
239239
header = fmt.Sprintf("[%s]", report.LeafNodeType)

reporters/default_reporter_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,6 +2961,26 @@ var _ = Describe("DefaultReporter", func() {
29612961
reporter = reporters.NewDefaultReporterUnderTest(types.ReporterConfig{FdOutput: true}, &buf)
29622962
})
29632963

2964+
Context("with silence-skips enabled", func() {
2965+
BeforeEach(func() {
2966+
buf.Reset()
2967+
reporter = reporters.NewDefaultReporterUnderTest(
2968+
types.ReporterConfig{FdOutput: true, SilenceSkips: true}, &buf)
2969+
reporter.SuiteWillBegin(types.Report{})
2970+
reporter.DidRun(types.SpecReport{
2971+
ContainerHierarchyTexts: []string{"DescribeA"},
2972+
LeafNodeText: "does something",
2973+
LeafNodeType: types.NodeTypeIt,
2974+
State: types.SpecStateSkipped,
2975+
})
2976+
reporter.SuiteDidEnd(types.Report{SpecReports: types.SpecReports{}})
2977+
})
2978+
2979+
It("omits skipped specs", func() {
2980+
Expect(buf.String()).NotTo(ContainSubstring("does something"))
2981+
})
2982+
})
2983+
29642984
Context("with a passing report", func() {
29652985
BeforeEach(func() {
29662986
reporter.SuiteWillBegin(types.Report{SuiteDescription: "Something"})

0 commit comments

Comments
 (0)