github.com/blend/go-sdk@v1.20220411.3/assert/constants.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package assert
     9  
    10  import "os"
    11  
    12  const (
    13  	// RED is the ansi escape code fragment for red.
    14  	RED = "31"
    15  	// BLUE is the ansi escape code fragment for blue.
    16  	BLUE = "94"
    17  	// GREEN is the ansi escape code fragment for green.
    18  	GREEN = "32"
    19  	// YELLOW is the ansi escape code fragment for yellow.
    20  	YELLOW = "33"
    21  	// WHITE is the ansi escape code fragment for white.
    22  	WHITE = "37"
    23  	// GRAY is the ansi escape code fragment for gray.
    24  	GRAY = "90"
    25  )
    26  
    27  // OutputFormatFromEnv gets the output format from the env or the default.
    28  func OutputFormatFromEnv() OutputFormat {
    29  	outputFormat := OutputFormatText
    30  	if envOutputFormat := os.Getenv("TEST_OUTPUT_FORMAT"); envOutputFormat != "" {
    31  		outputFormat = OutputFormat(envOutputFormat)
    32  	}
    33  	return outputFormat
    34  }
    35  
    36  // OutputFormat is an assertion error output format.
    37  type OutputFormat string
    38  
    39  // OutputFormats
    40  const (
    41  	OutputFormatDefault OutputFormat = ""
    42  	OutputFormatText    OutputFormat = "text"
    43  	OutputFormatJSON    OutputFormat = "json"
    44  )