diff --git a/hcl2template/formatter_test.go b/hcl2template/formatter_test.go index 9e565b5f7..a5cc9d30a 100644 --- a/hcl2template/formatter_test.go +++ b/hcl2template/formatter_test.go @@ -134,5 +134,9 @@ func TestHCL2Formatter_FormatNegativeCases(t *testing.T) { if tc.errExpected && !diags.HasErrors() { t.Fatalf("Expected error but got none") } + + if diags[0].Detail != "file testdata/format/test.json is not a HCL file" { + t.Fatalf("Expected error messge did not received") + } } }