File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 2323 run : go mod download
2424
2525 - name : Test
26- run : go test ./...
26+ run : go test -coverprofile=coverage.txt ./...
27+
28+ - name : Upload results to Codecov
29+ uses : codecov/codecov-action@v4
30+ with :
31+ token : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change 1+ coverage.txt
Original file line number Diff line number Diff line change 1+ # errgroup
2+
3+ [ ![ Go Reference] ( https://pkg.go.dev/badge/github.com/go-tstr/tstr.svg )] ( https://pkg.go.dev/github.com/go-tstr/tstr ) [ ![ codecov] ( https://codecov.io/github/go-tstr/tstr/graph/badge.svg?token=H3u7Ui9PfC )] ( https://codecov.io/github/go-tstr/tstr )
4+
5+ # Better testing with TSTR!
Original file line number Diff line number Diff line change @@ -28,16 +28,17 @@ type TestingT interface {
2828 Run (name string , fn func (* testing.T )) bool
2929}
3030
31- // exit is allows monkey-patching os.Exit in tests.
31+ // exit allows monkey-patching os.Exit in tests.
3232var exit = os .Exit
3333
3434// Run runs the test with the given options.
3535// Options are applied in the order they are passed.
3636// One of the options must provide the test function.
37+ //
3738// Options that provide the test function:
38- // - WithM
39- // - WithFn
40- // - WithTable
39+ // - WithM
40+ // - WithFn
41+ // - WithTable
4142func Run (opts ... Opt ) error {
4243 t := NewTester (opts ... )
4344 if err := t .Init (); err != nil {
@@ -49,7 +50,8 @@ func Run(opts ...Opt) error {
4950// RunMain is a convinience wrapper around Run that can be used inside TestMain.
5051// RunMain applies automatically WithM option which calls m.Run.
5152// Also os.Exit is called with non-zero exit code if Run returns any error.
52- // Example TestMain:
53+ //
54+ // Example:
5355//
5456// func TestMain(m *testing.M) {
5557// tstr.RunMain(m, tstr.WithDeps(MyDependency()))
You can’t perform that action at this time.
0 commit comments