MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / NewComponent

Function NewComponent

pkg/component/test/component.go:25–31  ·  view source on GitHub ↗

NewComponent returns a new Component that can be used for testing.

(tb testing.TB, config *component.Config, opts ...component.Option)

Source from the content-addressed store, hash-verified

23
24// NewComponent returns a new Component that can be used for testing.
25func NewComponent(tb testing.TB, config *component.Config, opts ...component.Option) *component.Component {
26 c, err := component.New(test.GetLogger(tb), config, opts...)
27 if err != nil {
28 tb.Fatalf("Failed to create component: %v", err)
29 }
30 return c
31}
32
33// StartComponent starts the component for testing.
34func StartComponent(tb testing.TB, c *component.Component) {

Callers

nothing calls this directly

Calls 3

NewFunction · 0.92
GetLoggerFunction · 0.92
FatalfMethod · 0.65

Tested by

no test coverage detected