func rewriteTestsInFile(pathToFile string) {
	fileSet := token.NewFileSet()
	rootNode, err := parser.ParseFile(fileSet, pathToFile, nil, parser.ParseComments)
	if err != nil {
		panic(fmt.Sprintf("Error parsing test file '%s':\n%s\n", pathToFile, err.Error()))
	}
	addGinkgoImports(rootNode)
	removeTestingImport(rootNode)
	varUnderscoreBlock := createVarUnderscoreBlock()
	describeBlock := createDescribeBlock()
	varUnderscoreBlock.Values = []ast.Expr{describeBlock}
	for _, testFunc := range findTestFuncs(rootNode) {
		rewriteTestFuncAsItStatement(testFunc, rootNode, describeBlock)
	}
	underscoreDecl := &ast.GenDecl{
		Tok:    85,  
		TokPos: 14,  
		Specs:  []ast.Spec{varUnderscoreBlock},
	}
	imports := rootNode.Decls[0]
	tail := rootNode.Decls[1:]
	rootNode.Decls = append(append([]ast.Decl{imports}, underscoreDecl), tail...)
	rewriteOtherFuncsToUseGinkgoT(rootNode.Decls)
	walkNodesInRootNodeReplacingTestingT(rootNode)
	var buffer bytes.Buffer
	if err = format.Node(&buffer, fileSet, rootNode); err != nil {
		panic(fmt.Sprintf("Error formatting ast node after rewriting tests.\n%s\n", err.Error()))
	}
	fileInfo, err := os.Stat(pathToFile)
	if err != nil {
		panic(fmt.Sprintf("Error stat'ing file: %s\n", pathToFile))
	}
	err = os.WriteFile(pathToFile, buffer.Bytes(), fileInfo.Mode())
}
/*
Given a file path, rewrites any tests in the Ginkgo format.
First, we parse the AST, and update the imports declaration.
Then, we walk the first child elements in the file, returning tests to rewrite.
A top level init func is declared, with a single Describe func inside.
Then the test functions to rewrite are inserted as It statements inside the Describe.
Finally we walk the rest of the file, replacing other usages of *testing.T
Once that is complete, we write the AST back out again to its file.
package convert
import (
	"bytes"
	"fmt"
	"go/ast"
	"go/format"
	"go/parser"
	"go/token"
	"os"
)