Skip to content

testid provides utilities of test id for unit testing of Go

License

Notifications You must be signed in to change notification settings

newmo-oss/testid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

testid provides utilities of test id for unit testing of Go

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages