mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: update slog to use logfmt (#7477)
This commit is contained in:
+12
-1
@@ -13,6 +13,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/muesli/termenv"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
@@ -33,8 +35,17 @@ var updateGoldenFiles = flag.Bool("update", false, "update .golden files")
|
||||
|
||||
var timestampRegex = regexp.MustCompile(`(?i)\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)?Z`)
|
||||
|
||||
// We need to override the global color profile.
|
||||
//
|
||||
//nolint:tparallel,paralleltest
|
||||
func TestCommandHelp(t *testing.T) {
|
||||
t.Parallel()
|
||||
ogColorProfile := lipgloss.ColorProfile()
|
||||
// ANSI256 escape codes are far easier for humans to parse in a diff,
|
||||
// but TrueColor is probably more popular with modern terminals.
|
||||
lipgloss.SetColorProfile(termenv.ANSI)
|
||||
t.Cleanup(func() {
|
||||
lipgloss.SetColorProfile(ogColorProfile)
|
||||
})
|
||||
rootClient, replacements := prepareTestData(t)
|
||||
|
||||
type testCase struct {
|
||||
|
||||
Reference in New Issue
Block a user