An open API service indexing awesome lists of open source software.

https://github.com/newmo-oss/testid

testid provides utilities of test id for unit testing of Go
https://github.com/newmo-oss/testid

golang testing

Last synced: over 1 year ago
JSON representation

testid provides utilities of test id for unit testing of Go

Awesome Lists containing this project

README

          

# testid [![Go Reference](https://pkg.go.dev/badge/github.com/newmo-oss/testido.svg)](https://pkg.go.dev/github.com/newmo-oss/testid)[![Go Report Card](https://goreportcard.com/badge/github.com/newmo-oss/testid)](https://goreportcard.com/report/github.com/newmo-oss/testid)

testid provides utilities of test id for unit testing of Go.

## Usage

```go
package a_test

import (
"context"
"testing"

"github.com/google/uuid"
"github.com/newmo-oss/newmotime"
"github.com/newmo-oss/newmotime/newmotimetest"
"github.com/newmo-oss/testid"
)

func Test(t *testing.T) {
tid := uuid.NewString()
ctx := testid.WithValue(context.Background(), tid)
now := newmotime.Now(ctx)
newmotimetest.SetFixedNow(t, ctx, now)
}
```

## License
MIT