@@ -35,7 +35,9 @@ func tinit(t *testing.T) graphql.Schema {
3535func TestExtensionInitPanic (t * testing.T ) {
3636 ext := newtestExt ("testExt" )
3737 ext .initFn = func (ctx context.Context , p * graphql.Params ) context.Context {
38- panic (errors .New ("test error" ))
38+ if true {
39+ panic (errors .New ("test error" ))
40+ }
3941 return ctx
4042 }
4143
@@ -62,7 +64,9 @@ func TestExtensionInitPanic(t *testing.T) {
6264func TestExtensionParseDidStartPanic (t * testing.T ) {
6365 ext := newtestExt ("testExt" )
6466 ext .parseDidStartFn = func (ctx context.Context ) (context.Context , graphql.ParseFinishFunc ) {
65- panic (errors .New ("test error" ))
67+ if true {
68+ panic (errors .New ("test error" ))
69+ }
6670 return ctx , func (err error ) {
6771
6872 }
@@ -119,7 +123,9 @@ func TestExtensionParseFinishFuncPanic(t *testing.T) {
119123func TestExtensionValidationDidStartPanic (t * testing.T ) {
120124 ext := newtestExt ("testExt" )
121125 ext .validationDidStartFn = func (ctx context.Context ) (context.Context , graphql.ValidationFinishFunc ) {
122- panic (errors .New ("test error" ))
126+ if true {
127+ panic (errors .New ("test error" ))
128+ }
123129 return ctx , func ([]gqlerrors.FormattedError ) {
124130
125131 }
@@ -176,7 +182,9 @@ func TestExtensionValidationFinishFuncPanic(t *testing.T) {
176182func TestExtensionExecutionDidStartPanic (t * testing.T ) {
177183 ext := newtestExt ("testExt" )
178184 ext .executionDidStartFn = func (ctx context.Context ) (context.Context , graphql.ExecutionFinishFunc ) {
179- panic (errors .New ("test error" ))
185+ if true {
186+ panic (errors .New ("test error" ))
187+ }
180188 return ctx , func (r * graphql.Result ) {
181189
182190 }
@@ -236,7 +244,9 @@ func TestExtensionExecutionFinishFuncPanic(t *testing.T) {
236244func TestExtensionResolveFieldDidStartPanic (t * testing.T ) {
237245 ext := newtestExt ("testExt" )
238246 ext .resolveFieldDidStartFn = func (ctx context.Context , i * graphql.ResolveInfo ) (context.Context , graphql.ResolveFieldFinishFunc ) {
239- panic (errors .New ("test error" ))
247+ if true {
248+ panic (errors .New ("test error" ))
249+ }
240250 return ctx , func (v interface {}, err error ) {
241251
242252 }
@@ -299,7 +309,9 @@ func TestExtensionResolveFieldFinishFuncPanic(t *testing.T) {
299309func TestExtensionGetResultPanic (t * testing.T ) {
300310 ext := newtestExt ("testExt" )
301311 ext .getResultFn = func (context.Context ) interface {} {
302- panic (errors .New ("test error" ))
312+ if true {
313+ panic (errors .New ("test error" ))
314+ }
303315 return nil
304316 }
305317 ext .hasResultFn = func () bool {
0 commit comments