macchiato

package module
v0.0.0-...-3be045c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2017 License: MIT Imports: 10 Imported by: 4

README

Macchiato

Documentation License

A mocha inspired reporter for Ginkgo

Macchiato

Example

Example

Usage

In your Ginkgo Suite, you can import Macchiato and use it as follows:

package books_test

import (
	"testing"

	"github.com/crowley-io/macchiato"
	"github.com/onsi/ginkgo"
	"github.com/onsi/gomega"
)

func TestBooks(t *testing.T) {
	gomega.RegisterFailHandler(ginkgo.Fail)
	macchiato.RunSpecs(t, "Books Suite")
}

Under the hood

macchiato.RunSpecs will run Ginkgo with RunSpecsWithCustomReporters and the default Ginkgo's Reporter. However, the underlying Stenographer is replaced with a Macchiato implementation, which handle the rendering on the console output.

License

This is Free Software, released under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Icons is a default SpecsIcons
	Icons = newSpecsIcons()
)

Functions

func NewReporter

func NewReporter() reporters.Reporter

NewReporter return a Macchiato reporter for Ginkgo.

func RunSpecs

func RunSpecs(t ginkgo.GinkgoTestingT, description string) bool

RunSpecs wrap ginkgo's RunSpecsWithCustomReporters by injecting its own Reporter.

Types

type SpecsIcons

type SpecsIcons struct {
	// contains filtered or unexported fields
}

SpecsIcons contains unicode "icons" for specs status.

type Stenographer

type Stenographer struct {
	// contains filtered or unexported fields
}

Stenographer implements github.com/onsi/ginkgo/reporters/stenographer.Stenographer interface. It handle the rendering of the Reporter in the user's console.

func NewStenographer

func NewStenographer(nc bool) *Stenographer

NewStenographer return a new Stenographer.

func (*Stenographer) AnnounceAfterSuiteFailure

func (s *Stenographer) AnnounceAfterSuiteFailure(summary *types.SetupSummary, quiet bool, fullTrace bool)

AnnounceAfterSuiteFailure will print the failure that hapenned in AfterSuite hook.

func (*Stenographer) AnnounceAggregatedParallelRun

func (s *Stenographer) AnnounceAggregatedParallelRun(nodes int, quiet bool)

AnnounceAggregatedParallelRun will do nothing.

func (*Stenographer) AnnounceBeforeSuiteFailure

func (s *Stenographer) AnnounceBeforeSuiteFailure(summary *types.SetupSummary, quiet bool, fullTrace bool)

AnnounceBeforeSuiteFailure will print the failure that hapenned in BeforeSuite hook.

func (*Stenographer) AnnounceCapturedOutput

func (s *Stenographer) AnnounceCapturedOutput(output string)

AnnounceCapturedOutput is a dead interface function, so it will do nothing.

func (*Stenographer) AnnounceNumberOfSpecs

func (s *Stenographer) AnnounceNumberOfSpecs(specsToRun int, total int, quiet bool)

AnnounceNumberOfSpecs will do nothing.

func (*Stenographer) AnnounceParallelRun

func (s *Stenographer) AnnounceParallelRun(node int, nodes int, succinct bool)

AnnounceParallelRun will do nothing.

func (*Stenographer) AnnouncePendingSpec

func (s *Stenographer) AnnouncePendingSpec(spec *types.SpecSummary, verbose bool)

AnnouncePendingSpec will print the stack of the spec with its status.

func (*Stenographer) AnnounceSkippedSpec

func (s *Stenographer) AnnounceSkippedSpec(spec *types.SpecSummary, quiet bool, fullTrace bool)

AnnounceSkippedSpec will do nothing.

func (*Stenographer) AnnounceSpecFailed

func (s *Stenographer) AnnounceSpecFailed(spec *types.SpecSummary, quiet bool, fullTrace bool)

AnnounceSpecFailed will print the stack of the spec with its status.

func (*Stenographer) AnnounceSpecPanicked

func (s *Stenographer) AnnounceSpecPanicked(spec *types.SpecSummary, quiet bool, fullTrace bool)

AnnounceSpecPanicked will print the stack of the spec with its status.

func (*Stenographer) AnnounceSpecRunCompletion

func (s *Stenographer) AnnounceSpecRunCompletion(summary *types.SuiteSummary, quiet bool)

AnnounceSpecRunCompletion will print a summary with some statistics of specs states.

func (*Stenographer) AnnounceSpecTimedOut

func (s *Stenographer) AnnounceSpecTimedOut(spec *types.SpecSummary, quiet bool, fullTrace bool)

AnnounceSpecTimedOut will print the stack of the spec with its status.

func (*Stenographer) AnnounceSpecWillRun

func (s *Stenographer) AnnounceSpecWillRun(spec *types.SpecSummary)

AnnounceSpecWillRun will do nothing.

func (*Stenographer) AnnounceSuccesfulMeasurement

func (s *Stenographer) AnnounceSuccesfulMeasurement(spec *types.SpecSummary, quiet bool)

AnnounceSuccesfulMeasurement will print the stack of the benchmark with its measurements.

func (*Stenographer) AnnounceSuccesfulSlowSpec

func (s *Stenographer) AnnounceSuccesfulSlowSpec(spec *types.SpecSummary, quiet bool)

AnnounceSuccesfulSlowSpec will print the stack of the spec with its status.

func (*Stenographer) AnnounceSuccesfulSpec

func (s *Stenographer) AnnounceSuccesfulSpec(spec *types.SpecSummary)

AnnounceSuccesfulSpec will print the stack of the spec with its status.

func (*Stenographer) AnnounceSuite

func (s *Stenographer) AnnounceSuite(description string, randomSeed int64, randomizingAll bool, quiet bool)

AnnounceSuite print the suite's description

func (*Stenographer) AnnounceTotalNumberOfSpecs

func (s *Stenographer) AnnounceTotalNumberOfSpecs(total int, succinct bool)

AnnounceTotalNumberOfSpecs will do nothing.

func (*Stenographer) SummarizeFailures

func (s *Stenographer) SummarizeFailures(summaries []*types.SpecSummary)

SummarizeFailures will print a summary of all failed specs with their context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL