From 0d7fd36f11ead4d35d09b51a00ba70ac54d5131d Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:58:44 -0600 Subject: [PATCH] test(prompter): replace assert with require --- internal/prompter/prompter_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/prompter/prompter_test.go b/internal/prompter/prompter_test.go index e610b3a7c..debaa4496 100644 --- a/internal/prompter/prompter_test.go +++ b/internal/prompter/prompter_test.go @@ -28,8 +28,8 @@ func TestNewReturnsAccessiblePrompter(t *testing.T) { p := New(editorCmd, stdin, stdout, stderr) - assert.IsType(t, &SpeechSynthesizerFriendlyPrompter{}, p, "expected huhPrompter to be returned") - assert.Equal(t, p.(*SpeechSynthesizerFriendlyPrompter).IsAccessible(), true, "expected huhPrompter to be accessible") + require.IsType(t, &SpeechSynthesizerFriendlyPrompter{}, p, "expected huhPrompter to be returned") + require.Equal(t, p.(*SpeechSynthesizerFriendlyPrompter).IsAccessible(), true, "expected huhPrompter to be accessible") }) t.Run("returns accessible huhPrompter when GH_SCREENREADER_FRIENDLY is set to 1", func(t *testing.T) { @@ -37,8 +37,8 @@ func TestNewReturnsAccessiblePrompter(t *testing.T) { p := New(editorCmd, stdin, stdout, stderr) - assert.IsType(t, &SpeechSynthesizerFriendlyPrompter{}, p, "expected huhPrompter to be returned") - assert.Equal(t, p.(*SpeechSynthesizerFriendlyPrompter).IsAccessible(), true, "expected huhPrompter to be accessible") + require.IsType(t, &SpeechSynthesizerFriendlyPrompter{}, p, "expected huhPrompter to be returned") + require.Equal(t, p.(*SpeechSynthesizerFriendlyPrompter).IsAccessible(), true, "expected huhPrompter to be accessible") }) t.Run("returns surveyPrompter when GH_SCREENREADER_FRIENDLY is set to false", func(t *testing.T) { @@ -46,7 +46,7 @@ func TestNewReturnsAccessiblePrompter(t *testing.T) { p := New(editorCmd, stdin, stdout, stderr) - assert.IsType(t, &surveyPrompter{}, p, "expected surveyPrompter to be returned") + require.IsType(t, &surveyPrompter{}, p, "expected surveyPrompter to be returned") }) t.Run("returns surveyPrompter when GH_SCREENREADER_FRIENDLY is set to 0", func(t *testing.T) { @@ -54,7 +54,7 @@ func TestNewReturnsAccessiblePrompter(t *testing.T) { p := New(editorCmd, stdin, stdout, stderr) - assert.IsType(t, &surveyPrompter{}, p, "expected surveyPrompter to be returned") + require.IsType(t, &surveyPrompter{}, p, "expected surveyPrompter to be returned") }) t.Run("returns surveyPrompter when GH_SCREENREADER_FRIENDLY is unset", func(t *testing.T) { @@ -62,7 +62,7 @@ func TestNewReturnsAccessiblePrompter(t *testing.T) { p := New(editorCmd, stdin, stdout, stderr) - assert.IsType(t, &surveyPrompter{}, p, "expected surveyPrompter to be returned") + require.IsType(t, &surveyPrompter{}, p, "expected surveyPrompter to be returned") }) }