Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 735 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 735 Bytes

testid Go ReferenceGo Report Card

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

Usage

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