diff --git a/errors_test.go b/errors_test.go index 3083d59..b2a2a67 100644 --- a/errors_test.go +++ b/errors_test.go @@ -27,7 +27,6 @@ func TestJSErrorFormat(t *testing.T) { } for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { t.Parallel() if s := fmt.Sprintf("%v", tt.err); s != tt.defaultVerb { diff --git a/function_test.go b/function_test.go index c141378..5894479 100644 --- a/function_test.go +++ b/function_test.go @@ -118,7 +118,6 @@ func TestFunctionCallError(t *testing.T) { require.ErrorAs(t, err, &jsErr) require.Equal(t, "error", jsErr.Message) require.Equal(t, "script.js:1:21", jsErr.Location) - } func TestFunctionSourceMapUrl(t *testing.T) { diff --git a/json_test.go b/json_test.go index 20715f4..9316d5d 100644 --- a/json_test.go +++ b/json_test.go @@ -5,10 +5,10 @@ package v8go_test import ( - "errors" "fmt" "testing" + "github.com/stretchr/testify/require" "github.com/zeiss/v8go" v8 "github.com/zeiss/v8go" ) @@ -29,9 +29,7 @@ func TestJSONParse(t *testing.T) { } var jerr *v8go.JSError - if errors.As(err, &jerr) { - t.Errorf("expected error to be of type JSError, got: %T", err) - } + require.ErrorAs(t, err, &jerr) } func TestJSONStringify(t *testing.T) { diff --git a/object_template_test.go b/object_template_test.go index 6665fe1..ff669a9 100644 --- a/object_template_test.go +++ b/object_template_test.go @@ -49,7 +49,6 @@ func TestObjectTemplate(t *testing.T) { } for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { setError(t, obj.Set(tt.name, tt.value, 0)) }) @@ -111,7 +110,6 @@ func TestGlobalObjectTemplate(t *testing.T) { } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { ctx := v8.NewContext(iso, tt.global()) val, err := ctx.RunScript(tt.source, "test.js") diff --git a/value_test.go b/value_test.go index 80a6fc1..c45a908 100644 --- a/value_test.go +++ b/value_test.go @@ -48,7 +48,6 @@ func TestValueFormatting(t *testing.T) { } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { val, _ := ctx.RunScript(tt.source, "test.js") if s := fmt.Sprintf("%v", val); s != tt.defaultVerb { @@ -86,7 +85,6 @@ func TestValueString(t *testing.T) { } for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { result, _ := ctx.RunScript(tt.source, "test.js") str := result.String() @@ -115,7 +113,6 @@ func TestNewValue(t *testing.T) { } for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { val, err := ctx.RunScript(tt.predicate, "test.js") if err != nil { @@ -160,7 +157,6 @@ func TestValueDetailString(t *testing.T) { } for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { result, _ := ctx.RunScript(tt.source, "test.js") str := result.DetailString() @@ -195,7 +191,6 @@ func TestValueBoolean(t *testing.T) { } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { val, _ := ctx.RunScript(tt.source, "test.js") if b := val.Boolean(); b != tt.out { @@ -258,7 +253,6 @@ func TestValueArrayIndex(t *testing.T) { } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { val, _ := ctx.RunScript(tt.source, "test.js") idx, ok := val.ArrayIndex() @@ -301,7 +295,6 @@ func TestValueInt32(t *testing.T) { } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { val, _ := ctx.RunScript(tt.source, "test.js") if i32 := val.Int32(); i32 != tt.expected { @@ -340,7 +333,6 @@ func TestValueInteger(t *testing.T) { } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { val, _ := ctx.RunScript(tt.source, "test.js") if i64 := val.Integer(); i64 != tt.expected { @@ -377,7 +369,6 @@ func TestValueNumber(t *testing.T) { } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { val, _ := ctx.RunScript(tt.source, "test.js") f64 := val.Number() @@ -410,7 +401,6 @@ func TestValueUint32(t *testing.T) { } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { val, _ := ctx.RunScript(tt.source, "test.js") if u32 := val.Uint32(); u32 != tt.expected { @@ -441,7 +431,6 @@ func TestValueBigInt(t *testing.T) { } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { ctx := v8.NewContext(iso) defer ctx.Close() @@ -636,7 +625,6 @@ func TestValueIsXXX(t *testing.T) { {"new Proxy({},{})", (*v8.Value).IsProxy}, } for _, tt := range tests { - t.Run(tt.source, func(t *testing.T) { ctx := v8.NewContext(iso) defer ctx.Close() @@ -694,7 +682,6 @@ func TestValueMarshalJSON(t *testing.T) { } for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { ctx := v8.NewContext(iso) defer ctx.Close()