ginkgo

package
v5.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 5 Imported by: 0

README

== Ginkgo utils

* link:ginkgo/ginkgo.go[] - Adds slog support to tests and code under test

[source,go]
----
package demo_test

import (
	"testing"

	"github.com/itbasis/go-test-utils/v5/ginkgo"
)

func TestSuite(t *testing.T) {
	ginkgo.InitGinkgoSuite(t, "Sample Suite")
}
----

Custom slog options

[source,go]
----
package demo_test

import (
	"log/slog"
	"testing"

	"github.com/itbasis/go-test-utils/v5/ginkgo"
)

func TestDemoSuite(t *testing.T) {
	ginkgo.InitGinkgoSuiteWithSlogOptions(t, "Sample Suite", &slog.HandlerOptions{
		Level: slog.LevelDebug,
		AddSource: false,
	})
}
----

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGinkgoSuite

func InitGinkgoSuite(t *testing.T, name string)

func InitGinkgoSuiteWithSlogOptions

func InitGinkgoSuiteWithSlogOptions(t *testing.T, name string, slogOptions *slog.HandlerOptions)

Types

This section is empty.

Jump to

Keyboard shortcuts

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